summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-23 22:34:02 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-23 22:34:02 +0000
commit7d2486e71e8777485ec85eb05c6e71341daf042a (patch)
tree8299d73fd02dd7d50d2ba7c439595315a8a9d43e /libmpdemux
parentea0995d63d3fcea263bc076e6ef0ba443602d1cf (diff)
downloadmpv-7d2486e71e8777485ec85eb05c6e71341daf042a.tar.bz2
mpv-7d2486e71e8777485ec85eb05c6e71341daf042a.tar.xz
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.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19175 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mov.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index eed30e6a7e..1e0379a5c5 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -622,6 +622,15 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
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 @@ quit_vorbis_block:
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",