changeset 892:1917a1f7d223 libavformat

try with auto_guess if first detection fails
author nicodvb
date Mon, 02 Jan 2006 20:27:15 +0000
parents 6e45fbd73a52
children 1a50f1735214
files mpegts.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mpegts.c	Mon Jan 02 20:13:24 2006 +0000
+++ b/mpegts.c	Mon Jan 02 20:27:15 2006 +0000
@@ -1183,6 +1183,7 @@
     ts->stream = s;
     ts->auto_guess = 0;
 
+goto_auto_guess:
     if (!ts->mpeg2ts_raw) {
         /* normal demux */
 
@@ -1235,8 +1236,15 @@
             }
             /* if could not find service, exit */
 
-            if (ts->set_service_ret != 0)
-                return -1;
+            if (ts->set_service_ret != 0) {
+                if(ts->auto_guess)
+                  return -1;
+                else {
+                  //let's retry with auto_guess set
+                 ts->auto_guess = 1;
+                 goto goto_auto_guess;
+                }
+            }
 
 #ifdef DEBUG_SI
             printf("tuning done\n");