summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorPetter Ericson <petter.ericson@codemill.se>2011-10-10 14:22:11 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-10 14:45:57 +0200
commit1fb30586cfe2597491ca814cca0cc6ef87c9346d (patch)
tree728f9489de159c02a85deab16a750584134ee91f /libavformat/mpegts.c
parent3c8862a5677f8a3eb30d71577807ba8f84ed46dd (diff)
downloadffmpeg-1fb30586cfe2597491ca814cca0cc6ef87c9346d.tar.gz
mpegts: Attempt to seek back to beginning in non-seekable mpegts files.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 7b4771b4e9..01c44a07b8 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1563,7 +1563,10 @@ static int mpegts_read_header(AVFormatContext *s,
/* normal demux */
/* first do a scaning to get all the services */
- if (pb->seekable && avio_seek(pb, pos, SEEK_SET) < 0)
+ /* NOTE: We attempt to seek on non-seekable files as well, as the
+ * probe buffer usually is big enough. Only warn if the seek failed
+ * on files where the seek should work. */
+ if (avio_seek(pb, pos, SEEK_SET) < 0)
av_log(s, AV_LOG_ERROR, "Unable to seek back to the start\n");
mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1);