[MPlayer-dev-eng] [PATCH] Automate mov to mpegps demuxer switch

Nico Sabbi nicola_sabbi at fastwebnet.it
Fri Aug 4 00:01:32 CEST 2006


Nico Sabbi wrote:

> Nico Sabbi wrote:
>
>>>
>>>   
>>
>>
>>
>> better but still wrong; I'll fix it tonight
>>
>>
>>
>
> attached is a cleaner patch; if demux_mov didn't suck so much an 
> better patch could be made.
> If no objects I'll commit it tomorrow
>
>------------------------------------------------------------------------
>
>Index: libmpdemux/demux_mov.c
>===================================================================
>--- libmpdemux/demux_mov.c	(revisione 19279)
>+++ libmpdemux/demux_mov.c	(copia locale)
>@@ -1890,6 +1890,21 @@
> 	}
>     }
> 
>+    if(demuxer->video->id<0 && demuxer->audio->id<0) {
>+        /* No AV streams found. Try to find an MPEG stream. */
>+        for(t_no=0;t_no<priv->track_db;t_no++){
>+            mov_track_t* trak=priv->tracks[t_no];
>+            if(trak->media_handler == MOV_FOURCC('M','P','E','G')) {
>+                demuxer->video->id = t_no;
>+                stream_t* s = new_ds_stream(demuxer->video);
>+                demuxer_t* od = demux_open(s, DEMUXER_TYPE_MPEG_PS, -1, -1, -1, NULL);
>+                if(od) return new_demuxers_demuxer(od, od, od);
>+                demuxer->video->id = -2;	//new linked demuxer couldn't be allocated
>+                break;
>+            }
>+        }
>+    }
>+
> #if 0
>     if( mp_msg_test(MSGT_DEMUX,MSGL_DBG3) ){
> 	for(t_no=0;t_no<priv->track_db;t_no++){
>  
>
>------------------------------------------------------------------------
>
>  
>

oops; C99-isms removed with this latter version
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mov2.diff
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060804/d1cc25c1/attachment.bin>


More information about the MPlayer-dev-eng mailing list