mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
rtpvp8pay: avoid reseting PictureID if NO_PICTURE_ID mode is set
There is no logical change here, as `& (1 << nbits) - 1` would produce also 0 when NO_PICTURE_ID mode is choosen. However, this avoid computing a random integer that is actually unused. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
This commit is contained in:
parent
7dd6375c5e
commit
a79616ea7a
1 changed files with 10 additions and 6 deletions
|
@ -112,13 +112,17 @@ gst_rtp_vp8_pay_picture_id_reset (GstRtpVP8Pay * obj)
|
||||||
{
|
{
|
||||||
gint nbits;
|
gint nbits;
|
||||||
|
|
||||||
if (obj->picture_id_offset == -1)
|
if (obj->picture_id_mode == VP8_PAY_NO_PICTURE_ID) {
|
||||||
obj->picture_id = g_random_int ();
|
obj->picture_id = 0;
|
||||||
else
|
} else {
|
||||||
obj->picture_id = obj->picture_id_offset;
|
if (obj->picture_id_offset == -1)
|
||||||
|
obj->picture_id = g_random_int ();
|
||||||
|
else
|
||||||
|
obj->picture_id = obj->picture_id_offset;
|
||||||
|
|
||||||
nbits = picture_id_field_len (obj->picture_id_mode);
|
nbits = picture_id_field_len (obj->picture_id_mode);
|
||||||
obj->picture_id &= (1 << nbits) - 1;
|
obj->picture_id &= (1 << nbits) - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue