aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXBMC <>2012-12-16 09:53:18 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-25 20:30:36 +0100
commit4c41fc88df5c507e0f239b4c16f85573f7b49702 (patch)
tree5eb67534053ca9a4e4d4b440ba918894a4d1ac79
parent928727f951d6cdfec278a71c88a486d178baa2da (diff)
downloadffmpeg-4c41fc88df5c507e0f239b4c16f85573f7b49702.tar.gz
mpegts: update AVProgram after pmt change
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpegts.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 5bd3c06ade..a6e07fae9c 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -182,10 +182,25 @@ typedef struct PESContext {
extern AVInputFormat ff_mpegts_demuxer;
+static void clear_avprogram(MpegTSContext *ts, unsigned int programid)
+{
+ AVProgram *prg = NULL;
+ int i;
+ for(i=0; i<ts->stream->nb_programs; i++)
+ if(ts->stream->programs[i]->id == programid){
+ prg = ts->stream->programs[i];
+ break;
+ }
+ if (!prg)
+ return;
+ prg->nb_stream_indexes = 0;
+}
+
static void clear_program(MpegTSContext *ts, unsigned int programid)
{
int i;
+ clear_avprogram(ts, programid);
for(i=0; i<ts->nb_prg; i++)
if(ts->prg[i].id == programid)
ts->prg[i].nb_pids = 0;
@@ -193,6 +208,9 @@ static void clear_program(MpegTSContext *ts, unsigned int programid)
static void clear_programs(MpegTSContext *ts)
{
+ int i;
+ for(i=0; i<ts->nb_prg; i++)
+ clear_avprogram(ts, ts->prg[i].id);
av_freep(&ts->prg);
ts->nb_prg=0;
}