mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
fixing some seek failure issues
Originally committed as revision 2688 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
909678c707
commit
e6c0297f1c
7
ffplay.c
7
ffplay.c
@ -1406,15 +1406,16 @@ static int decode_thread(void *arg)
|
|||||||
#endif
|
#endif
|
||||||
if (is->seek_req) {
|
if (is->seek_req) {
|
||||||
/* XXX: must lock decoder threads */
|
/* XXX: must lock decoder threads */
|
||||||
|
ret = av_seek_frame(is->ic, -1, is->seek_pos);
|
||||||
|
if (ret < 0) {
|
||||||
|
fprintf(stderr, "%s: error while seeking\n", is->ic->filename);
|
||||||
|
}else{
|
||||||
if (is->audio_stream >= 0) {
|
if (is->audio_stream >= 0) {
|
||||||
packet_queue_flush(&is->audioq);
|
packet_queue_flush(&is->audioq);
|
||||||
}
|
}
|
||||||
if (is->video_stream >= 0) {
|
if (is->video_stream >= 0) {
|
||||||
packet_queue_flush(&is->videoq);
|
packet_queue_flush(&is->videoq);
|
||||||
}
|
}
|
||||||
ret = av_seek_frame(is->ic, -1, is->seek_pos);
|
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr, "%s: error while seeking\n", is->ic->filename);
|
|
||||||
}
|
}
|
||||||
is->seek_req = 0;
|
is->seek_req = 0;
|
||||||
}
|
}
|
||||||
|
@ -496,6 +496,7 @@ static int avi_load_index(AVFormatContext *s)
|
|||||||
AVIContext *avi = s->priv_data;
|
AVIContext *avi = s->priv_data;
|
||||||
ByteIOContext *pb = &s->pb;
|
ByteIOContext *pb = &s->pb;
|
||||||
uint32_t tag, size;
|
uint32_t tag, size;
|
||||||
|
offset_t pos= url_ftell(pb);
|
||||||
|
|
||||||
url_fseek(pb, avi->movi_end, SEEK_SET);
|
url_fseek(pb, avi->movi_end, SEEK_SET);
|
||||||
#ifdef DEBUG_SEEK
|
#ifdef DEBUG_SEEK
|
||||||
@ -529,6 +530,7 @@ static int avi_load_index(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
the_end:
|
the_end:
|
||||||
|
url_fseek(pb, pos, SEEK_SET);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user