# HG changeset patch # User atmos4 # Date 1153694042 0 # Node ID 7e689bb31c070a8511fcb7b97da15266c3dff972 # Parent 70ea0a8d3b4a8113af5253e8ed4d74c981ad6216 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. diff -r 70ea0a8d3b4a -r 7e689bb31c07 libmpdemux/demux_mov.c --- 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",