summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-12-18 17:11:49 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-12-18 17:11:49 +0000
commit7238064f5c62b8e4ad78c37c5b36a53d81395f77 (patch)
treea1e5aad85f23cd585958eb8cb2a7df8a9c60593f /gst
parent75f32c38c5aa3470604b9f4d4c7be35bb53a53ad (diff)
downloadgst-plugins-bad-7238064f5c62b8e4ad78c37c5b36a53d81395f77.tar.gz
gst-plugins-bad-7238064f5c62b8e4ad78c37c5b36a53d81395f77.tar.bz2
gst-plugins-bad-7238064f5c62b8e4ad78c37c5b36a53d81395f77.zip
gst/qtdemux/qtdemux.c: Don't post BUFFERING messages in streaming mode if the stream headers are behind the movie dat...
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_post_progress), (gst_qtdemux_chain): Don't post BUFFERING messages in streaming mode if the stream headers are behind the movie data; instead, post "progress" element messages as a temporary solution. Apps might get confused and do silly things to the pipeline state if they see buffering messages from different sources and don't realize they come from different sources (#387160).
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 845e6bb2..2b62f481 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -1678,15 +1678,13 @@ next_entry_size (GstQTDemux * demux)
}
static void
-gst_qtdemux_post_buffering (GstQTDemux * demux, gint num, gint denom)
+gst_qtdemux_post_progress (GstQTDemux * demux, gint num, gint denom)
{
gint perc = (gint) ((gdouble) num * 100.0 / (gdouble) denom);
gst_element_post_message (GST_ELEMENT_CAST (demux),
- gst_message_new_custom (GST_MESSAGE_BUFFERING,
- GST_OBJECT_CAST (demux),
- gst_structure_new ("GstMessageBuffering",
- "buffer-percent", G_TYPE_INT, perc, NULL)));
+ gst_message_new_element (GST_OBJECT_CAST (demux),
+ gst_structure_new ("progress", "percent", G_TYPE_INT, perc, NULL)));
}
/* FIXME, unverified after edit list updates */
@@ -1801,7 +1799,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf)
demux->offset += demux->neededbytes;
demux->neededbytes = 16;
demux->state = QTDEMUX_STATE_INITIAL;
- gst_qtdemux_post_buffering (demux, 1, 1);
+ gst_qtdemux_post_progress (demux, 1, 1);
break;
}
@@ -1895,7 +1893,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf)
/* when buffering movie data, at least show user something is happening */
if (ret == GST_FLOW_OK && demux->state == QTDEMUX_STATE_BUFFER_MDAT &&
gst_adapter_available (demux->adapter) <= demux->neededbytes) {
- gst_qtdemux_post_buffering (demux, gst_adapter_available (demux->adapter),
+ gst_qtdemux_post_progress (demux, gst_adapter_available (demux->adapter),
demux->neededbytes);
}