# HG changeset patch # User arpi # Date 1041036011 0 # Node ID 0328af0565bfb2f135ca6a88378585496e10e5ed # Parent 889ae093092d8080126197206e8ff9913c2f38a2 ffmp2 (with mpeg files) sig11 fixed diff -r 889ae093092d -r 0328af0565bf libmpcodecs/ad_ffmpeg.c --- 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),