Skip to content

Commit

Permalink
Revert [6fb8692] to not use aacenc.c AAC encoder by default.
Browse files Browse the repository at this point in the history
We've been recommended not to use the native AAC encoder by default
since there are still some known issues with the encoder.  This
commit tries to be as minimally invasive as possible since we're
close to release, but it does change it so that the native AAC
encoder in libavcodec is not used unless neither libmp3lame nor
libfaac support was configured.

If the native AAC encoder is working fine for you then you don't
have to do anything.  If you want to use libmp3lame as MythTV v0.25
used, then configure MythTV with --enable-libmp3lame.  If you wish
to use AAC but prefer libfaac over the native AAC encoder, then
you can run configure with --enable-libfaac --enable-nonfree.  If
both --enable-libmp3lame and --enable-libfaac are used, then
libfaac will take precedence.
  • Loading branch information
cpinkham committed Aug 13, 2012
1 parent 5ff8a8a commit 2b3bd21
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
13 changes: 11 additions & 2 deletions mythtv/libs/libmythtv/avformatwriter.cpp
Expand Up @@ -605,10 +605,19 @@ AVStream* AVFormatWriter::AddAudioStream(void)
c->codec_id = m_ctx->oformat->audio_codec;
c->codec_type = AVMEDIA_TYPE_AUDIO;

if (c->codec_id == CODEC_ID_MP3)
c->sample_fmt = AV_SAMPLE_FMT_S16;
if (!gCoreContext->GetSetting("HLSAUDIO").isEmpty())
{
if (gCoreContext->GetSetting("HLSAUDIO") == "aac")
c->sample_fmt = AV_SAMPLE_FMT_FLT;
else
c->sample_fmt = AV_SAMPLE_FMT_S16;
}
else
#if CONFIG_LIBMP3LAME_ENCODER || CONFIG_LIBFAAC_ENCODER
c->sample_fmt = AV_SAMPLE_FMT_S16;
#else
c->sample_fmt = AV_SAMPLE_FMT_FLT;
#endif

m_audioBytesPerSample = m_audioChannels *
av_get_bytes_per_sample(c->sample_fmt);
Expand Down
26 changes: 21 additions & 5 deletions mythtv/programs/mythtranscode/transcode.cpp
Expand Up @@ -1097,10 +1097,18 @@ int Transcode::TranscodeFile(const QString &inputname,

avfw2->SetContainer("mpegts");

if (gCoreContext->GetNumSetting("HLSAACAUDIO", 1))
avfw2->SetAudioCodec("aac");
if (!gCoreContext->GetSetting("HLSAUDIO").isEmpty())
avfw2->SetAudioCodec(gCoreContext->GetSetting("HLSAUDIO"));
else
avfw2->SetAudioCodec("libmp3lame");
#if CONFIG_LIBFAAC_ENCODER
avfw2->SetAudioCodec("libfaac");
#else
# if CONFIG_LIBMP3LAME_ENCODER
avfw2->SetAudioCodec("libmp3lame");
# else
avfw2->SetAudioCodec("aac");
# endif
#endif

avfw2->SetAudioBitrate(audioOnlyBitrate);
avfw2->SetAudioChannels(arb->m_channels);
Expand All @@ -1112,10 +1120,18 @@ int Transcode::TranscodeFile(const QString &inputname,
avfw->SetContainer("mpegts");
avfw->SetVideoCodec("libx264");

if (gCoreContext->GetNumSetting("HLSAACAUDIO", 1))
avfw->SetAudioCodec("aac");
if (!gCoreContext->GetSetting("HLSAUDIO").isEmpty())
avfw->SetAudioCodec(gCoreContext->GetSetting("HLSAUDIO"));
else
#if CONFIG_LIBFAAC_ENCODER
avfw->SetAudioCodec("libfaac");
#else
# if CONFIG_LIBMP3LAME_ENCODER
avfw->SetAudioCodec("libmp3lame");
# else
avfw->SetAudioCodec("aac");
# endif
#endif

if (hlsStreamID == -1)
{
Expand Down

0 comments on commit 2b3bd21

Please sign in to comment.