changeset 19170:7e689bb31c07

Add simple edit list support to mov demuxer, it supports delay of audio and video tracks at the beginning of the file. E.g. video starts at 0.0s audio at 4.0s. It uses mplayers a/v-delay to achieve sync so please use with -framedrop for fastest sync. More Details in my mail to dev-eng from 2006-07-22.
author atmos4
date Sun, 23 Jul 2006 22:34:02 +0000
parents 70ea0a8d3b4a
children c525ee7bc300
files libmpdemux/demux_mov.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Sun Jul 23 21:16:11 2006 +0000
+++ b/libmpdemux/demux_mov.c	Sun Jul 23 22:34:02 2006 +0000
@@ -622,6 +622,15 @@
 		sh_audio_t* sh=new_sh_audio(demuxer,priv->track_db);
 		sh->format=trak->fourcc;
 
+		// crude audio delay from editlist0 hack ::atm
+		if(trak->editlist_size>=1) {
+		    if(trak->editlist[0].pos == -1) {
+			sh->stream_delay = (float)trak->editlist[0].dur/(float)priv->timescale;
+	    		mp_msg(MSGT_DEMUX,MSGL_V,"MOV: Initial Audio-Delay: %.3f sec\n", sh->stream_delay);
+		    }
+		}
+
+
 		switch( sh->format ) {
 		    case 0x726D6173: /* samr */
 			/* amr narrowband */
@@ -929,6 +938,15 @@
 		int depth;
 		sh->format=trak->fourcc;
 
+		// crude video delay from editlist0 hack ::atm
+		if(trak->editlist_size>=1) {
+		    if(trak->editlist[0].pos == -1) {
+			sh->stream_delay = (float)trak->editlist[0].dur/(float)priv->timescale;
+	    		mp_msg(MSGT_DEMUX,MSGL_V,"MOV: Initial Video-Delay: %.3f sec\n", sh->stream_delay);
+		    }
+		}
+
+
 		if (trak->stdata_len < 78) {
 		  mp_msg(MSGT_DEMUXER, MSGL_WARN,
 		  "MOV: Invalid (%d bytes instead of >= 78) video trak desc\n",