mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
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.
This commit is contained in:
parent
3b6e5acbce
commit
8a0f6da824
1 changed files with 5 additions and 3 deletions
|
@ -510,16 +510,18 @@ gst_message_new_buffering (GstObject * src, gint percent)
|
||||||
{
|
{
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
gint64 buffering_left;
|
||||||
|
|
||||||
g_return_val_if_fail (percent >= 0 && percent <= 100, NULL);
|
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),
|
structure = gst_structure_new_id (GST_QUARK (MESSAGE_BUFFERING),
|
||||||
GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, percent,
|
GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, percent,
|
||||||
GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
|
GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
|
||||||
GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1,
|
GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1,
|
||||||
GST_QUARK (AVG_OUT_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 (BUFFERING_LEFT), G_TYPE_INT64, buffering_left, NULL);
|
||||||
GST_QUARK (ESTIMATED_TOTAL), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
|
|
||||||
message = gst_message_new_custom (GST_MESSAGE_BUFFERING, src, structure);
|
message = gst_message_new_custom (GST_MESSAGE_BUFFERING, src, structure);
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
|
|
Loading…
Reference in a new issue