Mercurial > mplayer.hg
comparison libmpcodecs/ad_ffmpeg.c @ 8590:0328af0565bf
ffmp2 (with mpeg files) sig11 fixed
author | arpi |
---|---|
date | Sat, 28 Dec 2002 00:40:11 +0000 |
parents | d9b2b39e5c06 |
children | 3b3b7b6fdb22 |
comparison
equal
deleted
inserted
replaced
8589:889ae093092d | 8590:0328af0565bf |
---|---|
59 } | 59 } |
60 | 60 |
61 lavc_context = avcodec_alloc_context(); | 61 lavc_context = avcodec_alloc_context(); |
62 sh_audio->context=lavc_context; | 62 sh_audio->context=lavc_context; |
63 | 63 |
64 lavc_context->channels = sh_audio->wf->nChannels; | 64 if(sh_audio->wf){ |
65 lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec; | 65 lavc_context->channels = sh_audio->wf->nChannels; |
66 lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8; | 66 lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec; |
67 lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8; | |
68 lavc_context->block_align = sh_audio->wf->nBlockAlign; | |
69 } | |
67 lavc_context->fourcc = sh_audio->format; | 70 lavc_context->fourcc = sh_audio->format; |
68 lavc_context->block_align = sh_audio->wf->nBlockAlign; | 71 lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi |
69 lavc_context->codec_id = lavc_codec->id; | |
70 | 72 |
71 /* alloc extra data */ | 73 /* alloc extra data */ |
72 if (sh_audio->wf->cbSize > 0) { | 74 if (sh_audio->wf && sh_audio->wf->cbSize > 0) { |
73 lavc_context->extradata = malloc(sh_audio->wf->cbSize); | 75 lavc_context->extradata = malloc(sh_audio->wf->cbSize); |
74 lavc_context->extradata_size = sh_audio->wf->cbSize; | 76 lavc_context->extradata_size = sh_audio->wf->cbSize; |
75 memcpy(lavc_context->extradata, (char *)sh_audio->wf + sizeof(WAVEFORMATEX), | 77 memcpy(lavc_context->extradata, (char *)sh_audio->wf + sizeof(WAVEFORMATEX), |
76 lavc_context->extradata_size); | 78 lavc_context->extradata_size); |
77 } | 79 } |