ad_lavc: don't overwrite lavc bitrate

If the bitrate is already known in avcodec there is no need to overwrite
it again with the value from sh_audio.
This commit is contained in:
Marcoen Hirschberg 2014-05-27 16:45:53 +02:00 committed by wm4
parent ecea66e8dc
commit 696733d077
1 changed files with 3 additions and 2 deletions

View File

@ -270,8 +270,9 @@ static int init(struct dec_audio *da, const char *decoder)
}
}
da->bitrate = lavc_context->bit_rate;
if (sh_audio->wf && sh_audio->wf->nAvgBytesPerSec)
if (lavc_context->bit_rate != 0)
da->bitrate = lavc_context->bit_rate;
else if (sh_audio->wf && sh_audio->wf->nAvgBytesPerSec)
da->bitrate = sh_audio->wf->nAvgBytesPerSec * 8;
return 1;