Ticket #6263: hdpvr_audio_codec_selection-v1.1.diff

File hdpvr_audio_codec_selection-v1.1.diff, 3.3 KB (added by jppoet@…, 15 years ago)

fix typo

  • libs/libmythtv/mpegrecorder.cpp

     
    285285                    QString("%1 is invalid").arg(value));
    286286        }
    287287    }
     288    else if (opt == "audiocodec")
     289    {
     290        if (value == "AAC Hardware Encoder")
     291            audtype = 4;
     292        else if (value == "AC3 Hardware Encoder")
     293            audtype = 5;
     294    }
    288295    else
    289296    {
    290297        RecorderBase::SetOption(opt, value);
     
    340347    SetIntOption(profile, "medium_mpeg4peakbitrate");
    341348    SetIntOption(profile, "high_mpeg4avgbitrate");
    342349    SetIntOption(profile, "high_mpeg4peakbitrate");
     350
     351    SetStrOption(profile, "audiocodec");
    343352}
    344353
    345354// same as the base class, it just doesn't complain if an option is missing
     
    829838    {
    830839        maxbitrate = high_mpeg4peakbitrate;
    831840        bitrate    = high_mpeg4avgbitrate;
     841
     842        // query supported audio codecs
     843        struct v4l2_queryctrl qctrl;
     844        qctrl.id = V4L2_CID_MPEG_AUDIO_ENCODING;
     845
     846        if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) < 0)
     847        {
     848            VERBOSE(VB_IMPORTANT, LOC_WARN +
     849                    "Unable to get supported audio codecs." + ENO);
     850        }
     851        else
     852        {
     853            uint audio_encoding = max(min(audtype-1, qctrl.maximum), qctrl.minimum);
     854            add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_AUDIO_ENCODING,
     855                         audio_encoding);
     856        }
    832857    }
    833858    maxbitrate = std::max(maxbitrate, bitrate);
    834859
  • libs/libmythtv/recordingprofile.cpp

     
    424424        params->addChild(new SampleRate(parent));
    425425        params->addChild(new BTTVVolume(parent));
    426426        addTarget("Uncompressed", params);
     427
     428        params = new VerticalConfigurationGroup(false);
     429        params->setLabel("AC3 Hardware Encoder");
     430        addTarget("AC3 Hardware Encoder", params);
     431
     432        params = new VerticalConfigurationGroup(false);
     433        params->setLabel("AAC Hardware Encoder");
     434        addTarget("AAC Hardware Encoder", params);
     435
    427436    };
    428437
    429438    void selectCodecs(QString groupType)
     
    432441        {
    433442            if (groupType == "MPEG")
    434443               codecName->addSelection("MPEG-2 Hardware Encoder");
     444            else if (groupType == "HDPVR")
     445            {
     446                codecName->addSelection("AC3 Hardware Encoder");
     447                codecName->addSelection("AAC Hardware Encoder");
     448            }
    435449            else
    436450            {
    437451                // V4L, TRANSCODE (and any undefined types)
     
    12601274        videoSettings = new VideoCompressionSettings(*this, profileName);
    12611275        addChild(videoSettings);
    12621276
    1263         if (type.toUpper() != "HDPVR")
    1264         {
    1265             audioSettings = new AudioCompressionSettings(*this, profileName);
    1266             addChild(audioSettings);
    1267         }
     1277        audioSettings = new AudioCompressionSettings(*this, profileName);
     1278        addChild(audioSettings);
    12681279
    12691280        if (!profileName.isEmpty() && profileName.left(11) == "Transcoders")
    12701281        {