diff options
author | 2002-12-30 08:59:33 +0000 | |
---|---|---|
committer | 2002-12-30 08:59:33 +0000 | |
commit | 673897aa36f3974ea5573c4c1df901ce5d547e05 (patch) | |
tree | 08cb652c75413aa18a7afc839919d3dda41b1833 /libmpdemux/demux_ogg.c | |
parent | ac3b6c65523c941b5058dba1e9fa5c852ef8d085 (diff) |
bunkus: Fixed Ogg/Ogm seeking by discarding the first packet after the seek which may be incomplete
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8656 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ogg.c')
-rw-r--r-- | libmpdemux/demux_ogg.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c index 9ed49ae333..a7a504497b 100644 --- a/libmpdemux/demux_ogg.c +++ b/libmpdemux/demux_ogg.c @@ -901,7 +901,7 @@ void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { sh_audio_t* sh_audio = demuxer->audio->sh; ogg_packet op; float rate; - int i,sp; + int i,sp,first; vorbis_info* vi = NULL; int64_t gp = 0; off_t pos; @@ -961,6 +961,7 @@ void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { ogg_d->pos = pos; ogg_d->last_size = 0; + first = 1; while(1) { int np; ogg_d->pos += ogg_d->last_size; @@ -992,7 +993,13 @@ void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { continue; else if(np == 0) break; - + if (first) { /* Discard the first packet as it's probably broken, + and we don't have any other means to decide whether it is + complete or not. */ + first = 0; + break; + } + if( ((*op.packet & PACKET_IS_SYNCPOINT) || os->vorbis ) && (!ogg_d->syncpoints || op.granulepos >= gp) ) { demux_ogg_add_packet(ds,os,&op); |