diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-02 18:30:49 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-02 18:30:49 +0000 |
commit | 530ec15806fc901df55ec97c88e07792f627bd62 (patch) | |
tree | 82e30d0a09eb6ee06bce070791d308932d6d8d61 | |
parent | 79d12888875d1a83ef6b1e1a6fd4d9ed2726525b (diff) | |
download | gst-libav-530ec15806fc901df55ec97c88e07792f627bd62.tar.gz |
ext/ffmpeg/gstffmpegdemux.c: Signal no_more_pads.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
Signal no_more_pads.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_read),
(gst_ffmpegdata_seek):
Handle events.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpegdemux.c | 4 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpegprotocol.c | 16 |
3 files changed, 25 insertions, 3 deletions
@@ -1,5 +1,13 @@ 2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): + Signal no_more_pads. + * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_read), + (gst_ffmpegdata_seek): + Handle events. + +2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_pixfmt): * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link), diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index cfd05cd..9833a76 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -570,6 +570,7 @@ gst_ffmpegdemux_loop (GstElement * element) if (!demux->opened) { if (!gst_ffmpegdemux_open (demux)) return; + gst_element_no_more_pads (element); } /* read a package */ @@ -622,9 +623,10 @@ gst_ffmpegdemux_loop (GstElement * element) memcpy (GST_BUFFER_DATA (outbuf), pkt.data, pkt.size); GST_BUFFER_SIZE (outbuf) = pkt.size; - if (pkt.pts != AV_NOPTS_VALUE && demux->context->pts_den) + if (pkt.pts != AV_NOPTS_VALUE && demux->context->pts_den) { GST_BUFFER_TIMESTAMP (outbuf) = (double) pkt.pts * GST_SECOND * demux->context->pts_num / demux->context->pts_den; + } if (pkt.flags & PKT_FLAG_KEY) { GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_KEY_UNIT); diff --git a/ext/ffmpeg/gstffmpegprotocol.c b/ext/ffmpeg/gstffmpegprotocol.c index 373b7e7..cd0ca4b 100644 --- a/ext/ffmpeg/gstffmpegprotocol.c +++ b/ext/ffmpeg/gstffmpegprotocol.c @@ -145,6 +145,13 @@ gst_ffmpegdata_read (URLContext * h, unsigned char *buf, int size) have_event = FALSE; gst_event_unref (event); break; + case GST_EVENT_FLUSH: + gst_event_unref (event); + break; + case GST_EVENT_INTERRUPT: + have_event = FALSE; + gst_event_unref (event); + break; default: gst_pad_event_default (info->pad, event); break; @@ -219,6 +226,7 @@ gst_ffmpegdata_seek (URLContext * h, offset_t pos, int whence) /* handle discont */ gst_bytestream_seek (info->bs, pos, seek_type); + /* prevent eos */ if (gst_bytestream_tell (info->bs) == gst_bytestream_length (info->bs)) { @@ -239,11 +247,15 @@ gst_ffmpegdata_seek (URLContext * h, offset_t pos, int whence) g_warning ("unexpected/unwanted EOS event after seek"); info->eos = TRUE; gst_event_unref (event); - break; + return -1; case GST_EVENT_DISCONTINUOUS: - gst_bytestream_flush_fast (info->bs, remaining); gst_event_unref (event); /* we expect this */ break; + case GST_EVENT_FLUSH: + break; + case GST_EVENT_INTERRUPT: + gst_event_unref (event); + return -1; default: gst_pad_event_default (info->pad, event); break; |