diff options
-rw-r--r-- | xine/demux_xvdr.c | 7 | ||||
-rw-r--r-- | xine/ts2es.c | 14 | ||||
-rw-r--r-- | xine/ts2es.h | 4 |
3 files changed, 15 insertions, 10 deletions
diff --git a/xine/demux_xvdr.c b/xine/demux_xvdr.c index 3503ceda..79344eb3 100644 --- a/xine/demux_xvdr.c +++ b/xine/demux_xvdr.c @@ -505,7 +505,8 @@ static void demux_xvdr_parse_ts (demux_xvdr_t *this, buf_element_t *buf) /* demux video */ else if (ts_pid == ts_data->pmt.video_pid) { if (ts_data->video) { - buf_element_t *vbuf = ts2es_put(ts_data->video, buf->content); + fifo_buffer_t *src_fifo = buf->source; + buf_element_t *vbuf = ts2es_put(ts_data->video, buf->content, src_fifo); if (vbuf) { this->pts = vbuf->pts; check_newpts( this, vbuf, PTS_VIDEO ); @@ -521,7 +522,7 @@ static void demux_xvdr_parse_ts (demux_xvdr_t *this, buf_element_t *buf) for (i=0; i < ts_data->pmt.audio_tracks_count; i++) if (ts_pid == ts_data->pmt.audio_tracks[i].pid) { if (ts_data->audio[i]) { - buf_element_t *abuf = ts2es_put(ts_data->audio[i], buf->content); + buf_element_t *abuf = ts2es_put(ts_data->audio[i], buf->content, NULL); if (abuf) { this->pts = abuf->pts; check_newpts( this, abuf, PTS_AUDIO ); @@ -539,7 +540,7 @@ static void demux_xvdr_parse_ts (demux_xvdr_t *this, buf_element_t *buf) for (i=0; i < ts_data->pmt.spu_tracks_count; i++) if (ts_pid == ts_data->pmt.spu_tracks[i].pid) { if (ts_data->spu[i]) { - buf_element_t *sbuf = ts2es_put(ts_data->spu[i], buf->content); + buf_element_t *sbuf = ts2es_put(ts_data->spu[i], buf->content, NULL); if (sbuf) this->stream->video_fifo->put(this->stream->video_fifo, sbuf); } diff --git a/xine/ts2es.c b/xine/ts2es.c index a2303a3a..2eabb2ce 100644 --- a/xine/ts2es.c +++ b/xine/ts2es.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: ts2es.c,v 1.2 2009-08-07 12:06:55 phintuka Exp $ + * $Id: ts2es.c,v 1.3 2009-08-18 10:04:32 phintuka Exp $ * */ @@ -122,11 +122,11 @@ static void ts2es_parse_pes(ts2es_t *this) } } -buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data) +buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data, fifo_buffer_t *src_fifo) { - int bytes = ts_PAYLOAD_SIZE(data); - int pusi = ts_PAYLOAD_START(data); buf_element_t *result = NULL; + int bytes = ts_PAYLOAD_SIZE(data); + int pusi = ts_PAYLOAD_START(data); if (ts_HAS_ERROR(data)) { LOGDBG("ts2es: transport error"); @@ -157,7 +157,11 @@ buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data) if (!this->first_pusi_seen) return NULL; - this->buf = this->fifo->buffer_pool_alloc(this->fifo); + if (src_fifo && src_fifo != this->fifo) + this->buf = src_fifo->buffer_pool_try_alloc(src_fifo); + if (!this->buf) + this->buf = this->fifo->buffer_pool_alloc(this->fifo); + this->buf->type = this->xine_buf_type; this->buf->decoder_info[0] = 1; } diff --git a/xine/ts2es.h b/xine/ts2es.h index 8a5ab724..e009fc1c 100644 --- a/xine/ts2es.h +++ b/xine/ts2es.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: ts2es.h,v 1.1 2009-02-23 22:16:08 phintuka Exp $ + * $Id: ts2es.h,v 1.2 2009-08-18 10:04:32 phintuka Exp $ * */ @@ -14,7 +14,7 @@ typedef struct ts2es_s ts2es_t; ts2es_t *ts2es_init (fifo_buffer_t *dst_fifo, ts_stream_type stream_type, uint stream_index); -buf_element_t *ts2es_put (ts2es_t *ts2es, uint8_t *ts_packet); +buf_element_t *ts2es_put (ts2es_t *ts2es, uint8_t *ts_packet, fifo_buffer_t *src_fifo); void ts2es_flush (ts2es_t *ts2es); void ts2es_dispose (ts2es_t *ts2es); |