diff libmpcodecs/vd_ffmpeg.c @ 7736:b81b0ab0aa40

put M4S2 & MP4S headers in avctx->extradata (in the unlikely case that they arent missing completly)
author michael
date Mon, 14 Oct 2002 12:51:55 +0000
parents a181875e0aa8
children 25bf4f45639e
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Mon Oct 14 01:39:17 2002 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Mon Oct 14 12:51:55 2002 +0000
@@ -229,6 +229,14 @@
 
 //        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) {