[MPlayer-cvslog] r29709 - in trunk/libmpcodecs: ad_ffmpeg.c vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Wed Sep 23 21:21:38 CEST 2009


Author: reimar
Date: Wed Sep 23 21:21:38 2009
New Revision: 29709

Log:
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.

Modified:
   trunk/libmpcodecs/ad_ffmpeg.c
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	Wed Sep 23 21:04:24 2009	(r29708)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Wed Sep 23 21:21:38 2009	(r29709)
@@ -68,6 +68,7 @@ static int init(sh_audio_t *sh_audio)
     }
     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 */

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Wed Sep 23 21:04:24 2009	(r29708)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Wed Sep 23 21:21:38 2009	(r29709)
@@ -257,6 +257,8 @@ static int init(sh_video_t *sh){
     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){


More information about the MPlayer-cvslog mailing list