[FFmpeg-devel] [PATCH 1/2] Assume some TS packet size instead of failing completely.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Apr 24 17:35:34 CEST 2011


Fixes ticket #68.
---
 libavformat/mpegts.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 6a1e1ed..aea7af3 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1471,8 +1471,10 @@ static int mpegts_read_header(AVFormatContext *s,
     if (len != sizeof(buf))
         goto fail;
     ts->raw_packet_size = get_packet_size(buf, sizeof(buf));
-    if (ts->raw_packet_size <= 0)
-        goto fail;
+    if (ts->raw_packet_size <= 0) {
+        av_log(s, AV_LOG_WARNING, "Could not detect TS packet size, defaulting to non-FEC/DVHS\n");
+        ts->raw_packet_size = TS_PACKET_SIZE;
+    }
     ts->stream = s;
     ts->auto_guess = 0;
 
-- 
1.7.4.4



More information about the ffmpeg-devel mailing list