summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xine/demux_xvdr.c6
-rw-r--r--xine/ts2es.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/xine/demux_xvdr.c b/xine/demux_xvdr.c
index 79344eb3..da9334f2 100644
--- a/xine/demux_xvdr.c
+++ b/xine/demux_xvdr.c
@@ -460,7 +460,8 @@ static void demux_xvdr_parse_ts (demux_xvdr_t *this, buf_element_t *buf)
if (!this->ts_data)
this->ts_data = calloc(1, sizeof(ts_data_t));
- ts_data_t *ts_data = this->ts_data;
+ ts_data_t *ts_data = this->ts_data;
+ fifo_buffer_t *src_fifo = buf->source;
while (buf->size >= TS_SIZE) {
@@ -505,7 +506,6 @@ 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) {
- 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;
@@ -522,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, NULL);
+ buf_element_t *abuf = ts2es_put(ts_data->audio[i], buf->content, src_fifo);
if (abuf) {
this->pts = abuf->pts;
check_newpts( this, abuf, PTS_AUDIO );
diff --git a/xine/ts2es.c b/xine/ts2es.c
index 3c43b0b0..bb06d3ea 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.4 2009-08-25 10:00:48 phintuka Exp $
+ * $Id: ts2es.c,v 1.5 2009-08-25 10:09:20 phintuka Exp $
*
*/
@@ -158,10 +158,16 @@ buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data, fifo_buffer_t *src_fifo)
if (!this->first_pusi_seen)
return NULL;
- if (src_fifo && src_fifo != this->fifo)
- this->buf = src_fifo->buffer_pool_try_alloc(src_fifo);
- if (!this->buf)
+ if (src_fifo && src_fifo != this->fifo) {
+ if (!this->video)
+ this->buf = this->fifo->buffer_pool_try_alloc(this->fifo);
+ if (!this->buf)
+ this->buf = src_fifo->buffer_pool_try_alloc(src_fifo);
+ if (!this->buf)
+ this->buf = this->fifo->buffer_pool_alloc(this->fifo);
+ } else {
this->buf = this->fifo->buffer_pool_alloc(this->fifo);
+ }
this->buf->type = this->xine_buf_type;
this->buf->decoder_info[0] = 1;