changeset 398:0d92246d3644 libavformat

Support raw mpegts streams from dvr patch by (wmglo at dent dot med dot uni-muenchen dot de)
author michael
date Fri, 26 Mar 2004 17:40:40 +0000
parents f2f776a902c1
children 6ab5454567b6
files mpegts.c
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mpegts.c	Fri Mar 26 09:04:06 2004 +0000
+++ b/mpegts.c	Fri Mar 26 17:40:40 2004 +0000
@@ -378,7 +378,7 @@
     
 #ifdef DEBUG_SI
     printf("PMT:\n");
-    av_hex_dump((uint8_t *)section, section_len);
+    av_hex_dump(stdout, (uint8_t *)section, section_len);
 #endif
     p_end = section + section_len - 4;
     p = section;
@@ -453,7 +453,7 @@
 
 #ifdef DEBUG_SI
     printf("PAT:\n");
-    av_hex_dump((uint8_t *)section, section_len);
+    av_hex_dump(stdout, (uint8_t *)section, section_len);
 #endif
     p_end = section + section_len - 4;
     p = section;
@@ -502,7 +502,7 @@
 
 #ifdef DEBUG_SI
     printf("PAT:\n");
-    av_hex_dump((uint8_t *)section, section_len);
+    av_hex_dump(stdout, (uint8_t *)section, section_len);
 #endif
     p_end = section + section_len - 4;
     p = section;
@@ -563,7 +563,7 @@
 
 #ifdef DEBUG_SI
     printf("SDT:\n");
-    av_hex_dump((uint8_t *)section, section_len);
+    av_hex_dump(stdout, (uint8_t *)section, section_len);
 #endif
 
     p_end = section + section_len - 4;
@@ -1126,8 +1126,12 @@
                 handle_packets(ts, MAX_SCAN_PACKETS);
             }
             
-            if (ts->nb_services <= 0)
-                return -1;
+            if (ts->nb_services <= 0) {
+		/* raw transport stream */
+		ts->auto_guess = 1;
+		s->ctx_flags |= AVFMTCTX_NOHEADER;
+		goto do_pcr;
+	    }
             
             /* tune to first service found */
             service = ts->services[0];
@@ -1165,6 +1169,7 @@
         s->pts_num = 1;
         s->pts_den = 27000000;
         
+    do_pcr:
         st = av_new_stream(s, 0);
         if (!st)
             goto fail;