[MPlayer-dev-eng] [PATCH] stream switching for AVI demuxer

Nico Sabbi nsabbi at email.it
Thu Nov 30 22:02:22 CET 2006


Reimar Döffinger wrote:

>Hello,
>please test and comment on attached patch.
>
>Greetings,
>Reimar Döffinger
>  
>
>------------------------------------------------------------------------
>
>Index: libmpdemux/demux_avi.c
>===================================================================
>--- libmpdemux/demux_avi.c	(revision 21403)
>+++ libmpdemux/demux_avi.c	(working copy)
>@@ -762,6 +762,32 @@
> 	    if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS;
> 	    return DEMUXER_CTRL_OK;
> 
>+	case DEMUXER_CTRL_SWITCH_AUDIO:
>+	case DEMUXER_CTRL_SWITCH_VIDEO:
>+	{
>+	    int audio = (cmd == DEMUXER_CTRL_SWITCH_AUDIO);
>+	    demux_stream_t *ds = audio ? demuxer->audio : demuxer->video;
>+	    void **streams = audio ? demuxer->a_streams : demuxer->v_streams;
>+	    int maxid = FFMAX(99, audio ? MAX_A_STREAMS : MAX_V_STREAMS);
>+	    int chunkid;
>+	    if (ds->id < -1)
>+	      return DEMUXER_CTRL_NOTIMPL;
>+
>+	    if (*(int *)arg >= 0)
>+	      ds->id = *(int *)arg;
>+	    else {
>+	      do {
>+	        if (++ds->id >= maxid) ds->id = 0;
>+	      } while (!streams[ds->id]);
>+	    }
>  
>
inconsistent placement of braces

>+
>+	    chunkid = (ds->id / 10 + '0') | (ds->id % 10 + '0') << 8;
>+	    ds->sh = NULL;
>+	    demux_avi_select_stream(demuxer, chunkid);
>+	    *(int *)arg = ds->id;
>+	    return DEMUXER_CTRL_OK;
>+	}
>+
> 	default:
> 	    return DEMUXER_CTRL_NOTIMPL;
>     }
>  
>

I wonder why you still keep on posting patches rather than
committing straight away :) Is there anyone else working on demux_avi?




More information about the MPlayer-dev-eng mailing list