diff libmpdemux/demux_mkv.c @ 20920:94b1a797661f

Fix extradata passing to lavc RV20 decoder Pass video codec extradata unchanged from demux_real, sync vd_realvid to the new format Sync mkv demuxer to the changes above (cmsg24 extradata was totally broken before) Detect cmsg24 size from extradata (was fixed) Based on a patch by elupus >> elupus >a< ecce se <<
author rtogni
date Tue, 14 Nov 2006 22:40:35 +0000
parents a8b42366e68a
children b22dfe3ddfaa
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Tue Nov 14 22:10:40 2006 +0000
+++ b/libmpdemux/demux_mkv.c	Tue Nov 14 22:40:35 2006 +0000
@@ -1869,12 +1869,14 @@
           unsigned char *dst, *src;
           real_video_props_t *rvp;
           uint32_t type2;
+          unsigned int cnt;
 
           rvp = (real_video_props_t *) track->private_data;
           src = (unsigned char *) (rvp + 1);
 
-          bih = realloc(bih, sizeof (BITMAPINFOHEADER)+12);
-          bih->biSize = 48;
+          cnt = track->private_size - sizeof (real_video_props_t);
+          bih = realloc(bih, sizeof (BITMAPINFOHEADER)+8+cnt);
+          bih->biSize = 48+cnt;
           bih->biPlanes = 1;
           type2 = be2me_32 (rvp->type2);
           if (type2 == 0x10003000 || type2 == 0x10003001)
@@ -1882,17 +1884,9 @@
           else
             bih->biCompression=mmioFOURCC('R','V',track->codec_id[9],'0');
           dst = (unsigned char *) (bih + 1);
-          ((unsigned int *) dst)[0] = be2me_32 (rvp->type1);
-          ((unsigned int *) dst)[1] = type2;
-
-          if (bih->biCompression <= 0x30335652 && type2 >= 0x20200002)
-            {
-              /* read secondary WxH for the cmsg24[] (see vd_realvid.c) */
-              ((unsigned short *)(bih+1))[4] = 4 * (unsigned short) src[0];
-              ((unsigned short *)(bih+1))[5] = 4 * (unsigned short) src[1];
-            }
-          else
-            memset(&dst[8], 0, 4);
+          ((unsigned int *) dst)[0] = rvp->type1;
+          ((unsigned int *) dst)[1] = rvp->type2;
+          stream_read(demuxer->stream, dst+8, cnt);
           track->realmedia = 1;
 
 #ifdef USE_QTX_CODECS