summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ad_ffmpeg.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-28 00:40:11 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-28 00:40:11 +0000
commitb20d7437071a0e559d2cda3646e301e30a4b3128 (patch)
treece6995dff9553af71e90cf88b302ab79bad24e62 /libmpcodecs/ad_ffmpeg.c
parent625616cfbec6aed65f3dae827f9a536ddb65a2d1 (diff)
downloadmpv-b20d7437071a0e559d2cda3646e301e30a4b3128.tar.bz2
mpv-b20d7437071a0e559d2cda3646e301e30a4b3128.tar.xz
ffmp2 (with mpeg files) sig11 fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8591 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ad_ffmpeg.c')
-rw-r--r--libmpcodecs/ad_ffmpeg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index a930e0f5ca..573a9032ec 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -61,15 +61,17 @@ static int init(sh_audio_t *sh_audio)
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),