use the cached version. The reason for caching the result is because the
duration of a stream typically does not change that often.
-A GST_MESSAGE_DURATION posted by an element will clear the cached duration value
-so that the bin will query the sinks again. This message is typically posted by
-elements that calculate the duration of the stream based on some average
-bitrate, which might change while playing the stream. The DURATION message is
-posted to the application, which can then fetch the updated DURATION.
+A GST_MESSAGE_DURATION_CHANGED posted by an element will clear the cached
+duration value so that the bin will query the sinks again. This message is
+typically posted by elements that calculate the duration of the stream based
+on some average bitrate, which might change while playing the stream. The
+DURATION_CHANGED message is posted to the application, which can then fetch
+the updated DURATION.
Subclassing
An element or bin completed playback of a segment. This message is only posted
on the bus if a SEGMENT seek is performed on a pipeline.
-GST_MESSAGE_DURATION:
+GST_MESSAGE_DURATION_CHANGED:
An element posts this message when it has detected or updated the stream duration.
* result so we can answer it quicker the next time. Any element that
* changes its duration marks our cached values invalid.
* This message is also posted upwards. This is currently disabled
- * because too many elements don't post DURATION messages when the
- * duration changes.
+ * because too many elements don't post DURATION_CHANGED messages when
+ * the duration changes.
*
* GST_MESSAGE_CLOCK_LOST: This message is posted by an element when it
* can no longer provide a clock. The default bin behaviour is to
* for duration, we will recalculate. */
#if 0
GST_OBJECT_LOCK (bin);
- bin_remove_messages (bin, NULL, GST_MESSAGE_DURATION);
+ bin_remove_messages (bin, NULL, GST_MESSAGE_DURATION_CHANGED);
GST_OBJECT_UNLOCK (bin);
#endif
goto forward;
for (cached = bin->messages; cached; cached = g_list_next (cached)) {
GstMessage *message = (GstMessage *) cached->data;
- if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_DURATION &&
+ if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_DURATION_CHANGED &&
GST_MESSAGE_SRC (message) == GST_OBJECT_CAST (bin)) {
GstFormat format;
gint64 duration;