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:
Camilo Celis Guzman 2023-04-25 15:25:57 +09:00 committed by GStreamer Marge Bot
parent 7dd6375c5e
commit a79616ea7a

View file

@ -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