comparison libmpcodecs/ad_ffmpeg.c @ 29667:8cfbe411de01

Make sure avctx->codec_type and codec_id are set, since libavcodec currently requires that. That probably is an unintended API change and should be fixed/reverted in lavc but it hurts little to workaround here.
author reimar
date Wed, 23 Sep 2009 19:21:38 +0000
parents 93da3c10c2ac
children 282ea4fbe87d
comparison
equal deleted inserted replaced
29666:ca2030774a61 29667:8cfbe411de01
66 lavc_context->block_align = sh_audio->wf->nBlockAlign; 66 lavc_context->block_align = sh_audio->wf->nBlockAlign;
67 lavc_context->bits_per_coded_sample = sh_audio->wf->wBitsPerSample; 67 lavc_context->bits_per_coded_sample = sh_audio->wf->wBitsPerSample;
68 } 68 }
69 lavc_context->request_channels = audio_output_channels; 69 lavc_context->request_channels = audio_output_channels;
70 lavc_context->codec_tag = sh_audio->format; //FOURCC 70 lavc_context->codec_tag = sh_audio->format; //FOURCC
71 lavc_context->codec_type = CODEC_TYPE_AUDIO;
71 lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi 72 lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
72 73
73 /* alloc extra data */ 74 /* alloc extra data */
74 if (sh_audio->wf && sh_audio->wf->cbSize > 0) { 75 if (sh_audio->wf && sh_audio->wf->cbSize > 0) {
75 lavc_context->extradata = av_mallocz(sh_audio->wf->cbSize + FF_INPUT_BUFFER_PADDING_SIZE); 76 lavc_context->extradata = av_mallocz(sh_audio->wf->cbSize + FF_INPUT_BUFFER_PADDING_SIZE);