Commit 530ec158 authored by Ronald S. Bultje's avatar Ronald S. Bultje

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.
parent 79d12888
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),
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment