Commit 03c0c29a authored by michael's avatar michael

Support raw mpegts streams from dvr patch by (wmglo at dent dot med dot uni-muenchen dot de)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2931 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d755adc0
...@@ -2344,6 +2344,8 @@ static void check_audio_video_inputs(int *has_video_ptr, int *has_audio_ptr) ...@@ -2344,6 +2344,8 @@ static void check_audio_video_inputs(int *has_video_ptr, int *has_audio_ptr)
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
has_video = 1; has_video = 1;
break; break;
case CODEC_TYPE_DATA:
break;
default: default:
av_abort(); av_abort();
} }
......
...@@ -378,7 +378,7 @@ static void pmt_cb(void *opaque, const uint8_t *section, int section_len) ...@@ -378,7 +378,7 @@ static void pmt_cb(void *opaque, const uint8_t *section, int section_len)
#ifdef DEBUG_SI #ifdef DEBUG_SI
printf("PMT:\n"); printf("PMT:\n");
av_hex_dump((uint8_t *)section, section_len); av_hex_dump(stdout, (uint8_t *)section, section_len);
#endif #endif
p_end = section + section_len - 4; p_end = section + section_len - 4;
p = section; p = section;
...@@ -453,7 +453,7 @@ static void pat_cb(void *opaque, const uint8_t *section, int section_len) ...@@ -453,7 +453,7 @@ static void pat_cb(void *opaque, const uint8_t *section, int section_len)
#ifdef DEBUG_SI #ifdef DEBUG_SI
printf("PAT:\n"); printf("PAT:\n");
av_hex_dump((uint8_t *)section, section_len); av_hex_dump(stdout, (uint8_t *)section, section_len);
#endif #endif
p_end = section + section_len - 4; p_end = section + section_len - 4;
p = section; p = section;
...@@ -502,7 +502,7 @@ static void pat_scan_cb(void *opaque, const uint8_t *section, int section_len) ...@@ -502,7 +502,7 @@ static void pat_scan_cb(void *opaque, const uint8_t *section, int section_len)
#ifdef DEBUG_SI #ifdef DEBUG_SI
printf("PAT:\n"); printf("PAT:\n");
av_hex_dump((uint8_t *)section, section_len); av_hex_dump(stdout, (uint8_t *)section, section_len);
#endif #endif
p_end = section + section_len - 4; p_end = section + section_len - 4;
p = section; p = section;
...@@ -563,7 +563,7 @@ static void sdt_cb(void *opaque, const uint8_t *section, int section_len) ...@@ -563,7 +563,7 @@ static void sdt_cb(void *opaque, const uint8_t *section, int section_len)
#ifdef DEBUG_SI #ifdef DEBUG_SI
printf("SDT:\n"); printf("SDT:\n");
av_hex_dump((uint8_t *)section, section_len); av_hex_dump(stdout, (uint8_t *)section, section_len);
#endif #endif
p_end = section + section_len - 4; p_end = section + section_len - 4;
...@@ -1126,8 +1126,12 @@ static int mpegts_read_header(AVFormatContext *s, ...@@ -1126,8 +1126,12 @@ static int mpegts_read_header(AVFormatContext *s,
handle_packets(ts, MAX_SCAN_PACKETS); handle_packets(ts, MAX_SCAN_PACKETS);
} }
if (ts->nb_services <= 0) if (ts->nb_services <= 0) {
return -1; /* raw transport stream */
ts->auto_guess = 1;
s->ctx_flags |= AVFMTCTX_NOHEADER;
goto do_pcr;
}
/* tune to first service found */ /* tune to first service found */
service = ts->services[0]; service = ts->services[0];
...@@ -1165,6 +1169,7 @@ static int mpegts_read_header(AVFormatContext *s, ...@@ -1165,6 +1169,7 @@ static int mpegts_read_header(AVFormatContext *s,
s->pts_num = 1; s->pts_num = 1;
s->pts_den = 27000000; s->pts_den = 27000000;
do_pcr:
st = av_new_stream(s, 0); st = av_new_stream(s, 0);
if (!st) if (!st)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment