X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmpegts.c;h=02f0d56e5a748dcc6a92ebf4085a2c7962781ce1;hb=86602d1c79929caa1b88b942f0074b1481b52235;hp=b9efe8234ac40e4179a5c66d3db6d6bec44b466a;hpb=d2a847c203b5876e2bb5f0bc216b0af625f077a2;p=ffmpeg diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index b9efe8234ac..02f0d56e5a7 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -590,6 +590,8 @@ static void mpegts_find_stream_type(AVStream *st, static int mpegts_set_stream_info(AVStream *st, PESContext *pes, uint32_t stream_type, uint32_t prog_reg_desc) { + int old_codec_type= st->codec->codec_type; + int old_codec_id = st->codec->codec_id; av_set_pts_info(st, 33, 1, 90000); st->priv_data = pes; st->codec->codec_type = AVMEDIA_TYPE_DATA; @@ -634,6 +636,10 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, } if (st->codec->codec_id == CODEC_ID_NONE) mpegts_find_stream_type(st, pes->stream_type, MISC_types); + if (st->codec->codec_id == CODEC_ID_NONE){ + st->codec->codec_id = old_codec_id; + st->codec->codec_type= old_codec_type; + } return 0; } @@ -1438,7 +1444,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets) if (avio_tell(s->pb) != ts->last_pos) { int i; -// av_dlog("Skipping after seek\n"); + av_dlog(ts->stream, "Skipping after seek\n"); /* seek detected, flush pes buffer */ for (i = 0; i < NB_PID_MAX; i++) { if (ts->pids[i]) {