From 89e2a82da6cac38d13a22d2888dcc2ecf1a3f027 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Wed, 23 Nov 2011 13:09:09 +0200 Subject: demux_ts: added reset_track_map() --- src/demuxers/demux_ts.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index c47fc7755..b05e16212 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -413,6 +413,16 @@ typedef struct { config_values_t *config; } demux_ts_class_t; +static void reset_track_map(fifo_buffer_t *fifo) +{ + buf_element_t *buf = fifo->buffer_pool_alloc (fifo); + + buf->type = BUF_CONTROL_RESET_TRACK_MAP; + buf->decoder_info[1] = -1; + + fifo->put (fifo, buf); +} + /* TJ. dynamic PMT support. The idea is: First, reuse unchanged pids and add new ones. Then, comb out those who are no longer referenced. @@ -525,10 +535,7 @@ static void demux_ts_dynamic_pmt_clean (demux_ts_t *this) { } if ((tracks < this->audio_tracks_count) && this->audio_fifo) { /* at least 1 audio track removed, tell audio decoder loop */ - buf_element_t *b = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); - b->type = BUF_CONTROL_RESET_TRACK_MAP; - b->decoder_info[1] = -1; - this->audio_fifo->put (this->audio_fifo, b); + reset_track_map(this->audio_fifo); #ifdef LOG_DYNAMIC_PMT printf ("demux_ts: new audio track map\n"); #endif -- cgit v1.2.3