changeset 24226:352d7d9422b5

Set sample_rate and bit_rate from sh_audio as fallback in case sh_audio->wf is not available.
author reimar
date Mon, 27 Aug 2007 15:51:04 +0000
parents d15e78b799b5
children cc567f93fb3b
files libmpcodecs/ad_ffmpeg.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Mon Aug 27 15:21:12 2007 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Mon Aug 27 15:51:04 2007 +0000
@@ -59,6 +59,8 @@
     lavc_context = avcodec_alloc_context();
     sh_audio->context=lavc_context;
 
+    lavc_context->sample_rate = sh_audio->samplerate;
+    lavc_context->bit_rate = sh_audio->i_bps * 8;
     if(sh_audio->wf){
 	lavc_context->channels = sh_audio->wf->nChannels;
 	lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec;