From 425fa4b12abcf5d04544215aeae58b4af3cee24b Mon Sep 17 00:00:00 2001 From: Christophe Thommeret Date: Sun, 8 Jul 2007 15:25:07 +0100 Subject: Patch: mpeg_ts + ffmpeg Attached is a little patch that allows using ffmpegvideo w/o direct rendering to play mpeg2 ts. It works for both mpeg2 and h264. --- src/demuxers/demux_ts.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 57925deff..3bea3ef57 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -341,6 +341,8 @@ typedef struct { int32_t npkt_read; uint8_t buf[BUF_SIZE]; /* == PKT_SIZE * NPKT_PER_READ */ + + int numPreview; } demux_ts_t; @@ -895,6 +897,16 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts, m->buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE; m->buf->decoder_info[2] = SPU_DVD_SUBTYPE_PACKAGE; } + else { + if (this->numPreview<5) + ++this->numPreview; + if ( this->numPreview==1 ) + m->buf->decoder_flags=BUF_FLAG_HEADER | BUF_FLAG_FRAME_END; + else if ( this->numPreview<5 ) + m->buf->decoder_flags=BUF_FLAG_PREVIEW; + else + m->buf->decoder_flags=BUF_FLAG_FRAME_END; + } m->buf->pts = m->pts; m->buf->decoder_info[0] = 1; @@ -2260,6 +2272,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, /* dvb */ this->event_queue = xine_event_new_queue (this->stream); + this->numPreview=0; + return &this->demux_plugin; } -- cgit v1.2.3