From fc499bc5362f8c866426b3d9b3b68cab8c351886 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 14 Oct 2002 12:51:55 +0000 Subject: [PATCH] put M4S2 & MP4S headers in avctx->extradata (in the unlikely case that they arent missing completly) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7737 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index efcfbc7ba6..01ab2de994 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -229,6 +229,14 @@ static int init(sh_video_t *sh){ // printf("%X %X %d %d\n", extrahdr[0], extrahdr[1]); } + if (sh->bih && (sh->bih->biSize != sizeof(BITMAPINFOHEADER)) && + (sh->format == mmioFOURCC('M','4','S','2') || + sh->format == mmioFOURCC('M','P','4','S'))) + { + avctx->extradata_size = sh->bih->biSize-sizeof(BITMAPINFOHEADER); + avctx->extradata = malloc(avctx->extradata_size); + memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size); + } /* open it */ if (avcodec_open(avctx, lavc_codec) < 0) {