summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_lavc.c
diff options
context:
space:
mode:
authorMarcoen Hirschberg <m.hirschberg@activevideo.com>2014-05-27 16:45:53 +0200
committerwm4 <wm4@nowhere>2014-05-28 21:38:20 +0200
commit696733d077f51b09eda43062286f82103763f57d (patch)
tree09d91176958f893cdf3edab5582fd2e96d2d1821 /audio/decode/ad_lavc.c
parentecea66e8dcba7a1b6fc21fc90afe2630b1b04f39 (diff)
downloadmpv-696733d077f51b09eda43062286f82103763f57d.tar.bz2
mpv-696733d077f51b09eda43062286f82103763f57d.tar.xz
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.
Diffstat (limited to 'audio/decode/ad_lavc.c')
-rw-r--r--audio/decode/ad_lavc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index a55a5966ae..fff3a92380 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -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;