Mercurial > mplayer.hg
comparison libmpdemux/demux_mov.c @ 2545:89e3bf3c0c4e
seek ebfore begin of the movie fixed
author | arpi |
---|---|
date | Mon, 29 Oct 2001 22:11:40 +0000 |
parents | fd48f0d813b6 |
children | c9485365537d |
comparison
equal
deleted
inserted
replaced
2544:fd48f0d813b6 | 2545:89e3bf3c0c4e |
---|---|
745 if(!(flags&1)) sample+=trak->chunks[trak->pos].sample; // relative | 745 if(!(flags&1)) sample+=trak->chunks[trak->pos].sample; // relative |
746 trak->pos=0; | 746 trak->pos=0; |
747 while(trak->pos<trak->chunks_size && trak->chunks[trak->pos].sample<sample) ++trak->pos; | 747 while(trak->pos<trak->chunks_size && trak->chunks[trak->pos].sample<sample) ++trak->pos; |
748 pts=(float)(trak->chunks[trak->pos].sample*trak->duration)/(float)trak->timescale; | 748 pts=(float)(trak->chunks[trak->pos].sample*trak->duration)/(float)trak->timescale; |
749 } else { | 749 } else { |
750 unsigned int ipts=pts; | 750 unsigned int ipts; |
751 // printf("MOV track seek - sample: %d \n",ipts); | 751 if(!(flags&1)) pts+=trak->samples[trak->pos].pts; |
752 if(!(flags&1)) ipts+=trak->samples[trak->pos].pts; | 752 if(pts<0) pts=0; |
753 ipts=pts; | |
754 //printf("MOV track seek - sample: %d \n",ipts); | |
753 for(trak->pos=0;trak->pos<trak->samples_size;++trak->pos){ | 755 for(trak->pos=0;trak->pos<trak->samples_size;++trak->pos){ |
754 if(trak->samples[trak->pos].pts>=ipts) break; // found it! | 756 if(trak->samples[trak->pos].pts>=ipts) break; // found it! |
755 } | 757 } |
756 if(trak->keyframes_size){ | 758 if(trak->keyframes_size){ |
757 // find nearest keyframe | 759 // find nearest keyframe |