Mercurial > mplayer.hg
comparison libmpdemux/demux_mov.c @ 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 | 83c3afeab35d |
children | 0a78cbf7c24f |
comparison
equal
deleted
inserted
replaced
19169:70ea0a8d3b4a | 19170:7e689bb31c07 |
---|---|
620 int version, adjust; | 620 int version, adjust; |
621 int is_vorbis = 0; | 621 int is_vorbis = 0; |
622 sh_audio_t* sh=new_sh_audio(demuxer,priv->track_db); | 622 sh_audio_t* sh=new_sh_audio(demuxer,priv->track_db); |
623 sh->format=trak->fourcc; | 623 sh->format=trak->fourcc; |
624 | 624 |
625 // crude audio delay from editlist0 hack ::atm | |
626 if(trak->editlist_size>=1) { | |
627 if(trak->editlist[0].pos == -1) { | |
628 sh->stream_delay = (float)trak->editlist[0].dur/(float)priv->timescale; | |
629 mp_msg(MSGT_DEMUX,MSGL_V,"MOV: Initial Audio-Delay: %.3f sec\n", sh->stream_delay); | |
630 } | |
631 } | |
632 | |
633 | |
625 switch( sh->format ) { | 634 switch( sh->format ) { |
626 case 0x726D6173: /* samr */ | 635 case 0x726D6173: /* samr */ |
627 /* amr narrowband */ | 636 /* amr narrowband */ |
628 trak->samplebytes=sh->samplesize=1; | 637 trak->samplebytes=sh->samplesize=1; |
629 trak->nchannels=sh->channels=1; | 638 trak->nchannels=sh->channels=1; |
926 int hdr_ptr = 76; // the byte just after depth | 935 int hdr_ptr = 76; // the byte just after depth |
927 unsigned char *palette_map; | 936 unsigned char *palette_map; |
928 sh_video_t* sh=new_sh_video(demuxer,priv->track_db); | 937 sh_video_t* sh=new_sh_video(demuxer,priv->track_db); |
929 int depth; | 938 int depth; |
930 sh->format=trak->fourcc; | 939 sh->format=trak->fourcc; |
940 | |
941 // crude video delay from editlist0 hack ::atm | |
942 if(trak->editlist_size>=1) { | |
943 if(trak->editlist[0].pos == -1) { | |
944 sh->stream_delay = (float)trak->editlist[0].dur/(float)priv->timescale; | |
945 mp_msg(MSGT_DEMUX,MSGL_V,"MOV: Initial Video-Delay: %.3f sec\n", sh->stream_delay); | |
946 } | |
947 } | |
948 | |
931 | 949 |
932 if (trak->stdata_len < 78) { | 950 if (trak->stdata_len < 78) { |
933 mp_msg(MSGT_DEMUXER, MSGL_WARN, | 951 mp_msg(MSGT_DEMUXER, MSGL_WARN, |
934 "MOV: Invalid (%d bytes instead of >= 78) video trak desc\n", | 952 "MOV: Invalid (%d bytes instead of >= 78) video trak desc\n", |
935 trak->stdata_len); | 953 trak->stdata_len); |