urisourcebin: Avoid potential unitialized/wrong bitrate value
Only calculate and set the bitrate if all conditions are met.
This commit is contained in:
parent
18942d7875
commit
23d1440a60
@ -1003,15 +1003,13 @@ update_queue_values (GstURISourceBin * urisrc)
|
|||||||
|
|
||||||
for (cur = urisrc->out_slots; cur != NULL; cur = g_slist_next (cur)) {
|
for (cur = urisrc->out_slots; cur != NULL; cur = g_slist_next (cur)) {
|
||||||
OutputSlotInfo *slot = (OutputSlotInfo *) (cur->data);
|
OutputSlotInfo *slot = (OutputSlotInfo *) (cur->data);
|
||||||
guint64 bitrate;
|
|
||||||
guint byte_limit;
|
guint byte_limit;
|
||||||
|
|
||||||
if (cumulative_bitrate > 0) {
|
if (cumulative_bitrate > 0
|
||||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (slot->queue),
|
&& g_object_class_find_property (G_OBJECT_GET_CLASS (slot->queue),
|
||||||
"bitrate")) {
|
"bitrate")) {
|
||||||
g_object_get (G_OBJECT (slot->queue), "bitrate", &bitrate, NULL);
|
guint64 bitrate;
|
||||||
}
|
g_object_get (G_OBJECT (slot->queue), "bitrate", &bitrate, NULL);
|
||||||
|
|
||||||
byte_limit =
|
byte_limit =
|
||||||
gst_util_uint64_scale (buffer_size, bitrate, cumulative_bitrate);
|
gst_util_uint64_scale (buffer_size, bitrate, cumulative_bitrate);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user