changeset 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 ca2030774a61
children ecc719c6d7a9
files libmpcodecs/ad_ffmpeg.c libmpcodecs/vd_ffmpeg.c
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Wed Sep 23 19:04:24 2009 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Wed Sep 23 19:21:38 2009 +0000
@@ -68,6 +68,7 @@
     }
     lavc_context->request_channels = audio_output_channels;
     lavc_context->codec_tag = sh_audio->format; //FOURCC
+    lavc_context->codec_type = CODEC_TYPE_AUDIO;
     lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
 
     /* alloc extra data */
--- a/libmpcodecs/vd_ffmpeg.c	Wed Sep 23 19:04:24 2009 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Wed Sep 23 19:21:38 2009 +0000
@@ -257,6 +257,8 @@
     ctx->avctx = avcodec_alloc_context();
     avctx = ctx->avctx;
     avctx->opaque = sh;
+    avctx->codec_type = CODEC_TYPE_VIDEO;
+    avctx->codec_id = lavc_codec->id;
 
 #if CONFIG_VDPAU
     if(lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU){