From: Wim Taymans Date: Thu, 19 Jul 2012 08:14:18 +0000 (+0200) Subject: message: improve buffering message defaults X-Git-Tag: RELEASE-0.11.93~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a0f6da824b9fc573dde73ad632a3f933b2528e1;p=platform%2Fupstream%2Fgstreamer.git message: improve buffering message defaults Remove the estimated-total field, this should not be part of the buffering message. Set the default value of buffering-left to 0 when the percent is 100. --- diff --git a/gst/gstmessage.c b/gst/gstmessage.c index f531e50..d7a9735 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -499,7 +499,7 @@ gst_message_new_tag (GstObject * src, GstTagList * tag_list) * The application must be prepared to receive BUFFERING messages in the * PREROLLING state and may only set the pipeline to PLAYING after receiving a * message with @percent set to 100, which can happen after the pipeline - * completed prerolling. + * completed prerolling. * * MT safe. * @@ -510,16 +510,18 @@ gst_message_new_buffering (GstObject * src, gint percent) { GstMessage *message; GstStructure *structure; + gint64 buffering_left; g_return_val_if_fail (percent >= 0 && percent <= 100, NULL); + buffering_left = (percent == 100 ? 0 : -1); + structure = gst_structure_new_id (GST_QUARK (MESSAGE_BUFFERING), GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, percent, GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM, GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1, GST_QUARK (AVG_OUT_RATE), G_TYPE_INT, -1, - GST_QUARK (BUFFERING_LEFT), G_TYPE_INT64, G_GINT64_CONSTANT (-1), - GST_QUARK (ESTIMATED_TOTAL), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL); + GST_QUARK (BUFFERING_LEFT), G_TYPE_INT64, buffering_left, NULL); message = gst_message_new_custom (GST_MESSAGE_BUFFERING, src, structure); return message;