]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpegts.c
Do not try to parse empty strf tags.
[ffmpeg] / libavformat / mpegts.c
index 7b4771b4e9a9b0a1ea7055caf39dbcfd965f951c..5196fab1e4d485801c8626578c5d0b8e3fdaf569 100644 (file)
@@ -126,7 +126,7 @@ struct MpegTSContext {
 };
 
 static const AVOption options[] = {
-    {"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), FF_OPT_TYPE_INT,
+    {"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT,
      {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
@@ -1563,8 +1563,11 @@ 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)
-            av_log(s, AV_LOG_ERROR, "Unable to seek back to the start\n");
+        /* 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, pb->seekable ? AV_LOG_ERROR : AV_LOG_INFO, "Unable to seek back to the start\n");
 
         mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1);