diff libmpcodecs/ad_ffmpeg.c @ 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 51cd49ee92d6
children dfa8a510c81c
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;