[Mplayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.55,1.56

Arpi of Ize arpi at mplayerhq.hu
Tue Oct 1 23:30:23 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv31748

Modified Files:
	vd_ffmpeg.c 
Log Message:
fixing RV10 streamcopy - detect packet format (simple single frame vs. slices
with extra header + offset tab) based on codec header instead of demuxer type


Index: vd_ffmpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_ffmpeg.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- vd_ffmpeg.c	1 Oct 2002 20:00:52 -0000	1.55
+++ vd_ffmpeg.c	1 Oct 2002 21:30:10 -0000	1.56
@@ -200,19 +200,21 @@
 #endif
     if(   sh->format == mmioFOURCC('R', 'V', '1', '0')
        || sh->format == mmioFOURCC('R', 'V', '1', '3')){
-        unsigned int* extrahdr=(unsigned int*)(sh->bih+1);
         avctx->extradata_size= 8;
         avctx->extradata = malloc(avctx->extradata_size);
-        if(sh->ds->demuxer->type != DEMUXER_TYPE_REAL){
-            /* not .rm container -> only 1 packet per frame & sub_id from fourcc */
-            if (sh->format == mmioFOURCC('R', 'V', '1', '3'))
-	        extrahdr[1] = 0x10003001;
-            else
-	        extrahdr[1] = 0x10000000;
-        }
-        ((uint32_t*)avctx->extradata)[0] = extrahdr[0];
-        ((uint32_t*)avctx->extradata)[1] = extrahdr[1];
-        avctx->sub_id= extrahdr[1];
+        if(sh->bih->biSize!=sizeof(*sh->bih)+8){
+            /* only 1 packet per frame & sub_id from fourcc */
+	    ((uint32_t*)avctx->extradata)[0] = 0;
+	    avctx->sub_id=
+	    ((uint32_t*)avctx->extradata)[1] =
+        	(sh->format == mmioFOURCC('R', 'V', '1', '3')) ? 0x10003001 : 0x10000000;
+        } else {
+	    /* has extra slice header (demux_rm or rm->avi streamcopy) */
+	    unsigned int* extrahdr=(unsigned int*)(sh->bih+1);
+	    ((uint32_t*)avctx->extradata)[0] = extrahdr[0];
+	    avctx->sub_id=
+	    ((uint32_t*)avctx->extradata)[1] = extrahdr[1];
+	}
 
 //        printf("%X %X %d %d\n", extrahdr[0], extrahdr[1]);
     }
@@ -473,7 +475,10 @@
 #endif
 
 #if LIBAVCODEC_BUILD >= 4630
-    if(sh->ds->demuxer->type == DEMUXER_TYPE_REAL){
+//    if(sh->ds->demuxer->type == DEMUXER_TYPE_REAL){
+    if(   sh->format == mmioFOURCC('R', 'V', '1', '0')
+       || sh->format == mmioFOURCC('R', 'V', '1', '3'))
+    if(sh->bih->biSize==sizeof(*sh->bih)+8){
         int i;
         dp_hdr_t *hdr= (dp_hdr_t*)data;
 




More information about the MPlayer-cvslog mailing list