Skip to content

Commit

Permalink
Update AC3 encoder following ffmpeg resync.
Browse files Browse the repository at this point in the history
AC3 encoder by default now use float ; use the older fixed S16 one. To do: check if working with float is any faster as most of the time will be already working internally with floats.

Fixes #9755.
  • Loading branch information
jyavenard committed May 2, 2011
1 parent be5a32c commit b91605c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions mythtv/libs/libmyth/audiooutputdigitalencoder.cpp
Expand Up @@ -66,19 +66,24 @@ bool AudioOutputDigitalEncoder::Init(
// We need to do this when called from mythmusic
avcodec_init();
avcodec_register_all();
codec = avcodec_find_encoder(CODEC_ID_AC3);
codec = avcodec_find_encoder_by_name("ac3_fixed");
//codec = avcodec_find_encoder(CODEC_ID_AC3);
if (!codec)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "Could not find codec");
return false;
}

av_context = avcodec_alloc_context();
av_context->bit_rate = bitrate;
av_context->sample_rate = samplerate;
av_context->channels = channels;
av_context = avcodec_alloc_context();
avcodec_get_context_defaults3(av_context, codec);

// open it */
av_context->bit_rate = bitrate;
av_context->sample_rate = samplerate;
av_context->channels = channels;
av_context->channel_layout = CH_LAYOUT_5POINT1;
av_context->sample_fmt = AV_SAMPLE_FMT_S16;

// open it
ret = avcodec_open(av_context, codec);
if (ret < 0)
{
Expand Down

0 comments on commit b91605c

Please sign in to comment.