changeset 8590:0328af0565bf

ffmp2 (with mpeg files) sig11 fixed
author arpi
date Sat, 28 Dec 2002 00:40:11 +0000
parents 889ae093092d
children 35bfd508bf5f
files libmpcodecs/ad_ffmpeg.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Sat Dec 28 00:26:10 2002 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Sat Dec 28 00:40:11 2002 +0000
@@ -61,15 +61,17 @@
     lavc_context = avcodec_alloc_context();
     sh_audio->context=lavc_context;
 
-    lavc_context->channels = sh_audio->wf->nChannels;
-    lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec;
-    lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8;
+    if(sh_audio->wf){
+	lavc_context->channels = sh_audio->wf->nChannels;
+	lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec;
+	lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8;
+	lavc_context->block_align = sh_audio->wf->nBlockAlign;
+    }
     lavc_context->fourcc = sh_audio->format;
-    lavc_context->block_align = sh_audio->wf->nBlockAlign;
-    lavc_context->codec_id = lavc_codec->id;
+    lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
 
     /* alloc extra data */
-    if (sh_audio->wf->cbSize > 0) {
+    if (sh_audio->wf && sh_audio->wf->cbSize > 0) {
         lavc_context->extradata = malloc(sh_audio->wf->cbSize);
         lavc_context->extradata_size = sh_audio->wf->cbSize;
         memcpy(lavc_context->extradata, (char *)sh_audio->wf + sizeof(WAVEFORMATEX),