GNOME Bugzilla – Bug 757520
rtpbin: logically dead code
Last modified: 2018-05-04 11:55:05 UTC
there is dead code in in gst_rtp_bin_associate(). I will attach the patch soon.
Created attachment 314783 [details] [review] rtpbin: remove logically dead code static void gst_rtp_bin_associate() { .. switch (rtcp_sync) { case GST_RTP_BIN_RTCP_SYNC_RTP: if (!use_rtp) break; .. } ==> "!use_rtp" can not be true.
Review of attachment 314783 [details] [review]: Perhaps it would make sense to declare the variable inside the block it is needed to avoid it being used in the future in places it shouldn't. Otherwise it looks good to me.
static void gst_rtp_bin_associate() { .. /* warn and bail for clarity out if no sane values */ if (!use_rtp) { GST_WARNING_OBJECT (bin, "unable to sync to provided rtptime"); return; } ... switch (rtcp_sync) { case GST_RTP_BIN_RTCP_SYNC_RTP: if (!use_rtp) break; .. } ok. perhaps, it might be needed in the future. but, it is not needed currently . it would be returned before going to the dead code place if '!use_rtp' is true.
thank you for review
(In reply to jihae from comment #3) > > ok. > perhaps, it might be needed in the future. > but, it is not needed currently . > it would be returned before going to the dead code place if '!use_rtp' is > true. Yes, the idea of moving it to the inner block is just to prevent unintended use of it.
I'm pretty sure this isn't a dead codepath, there is some code inside the if() branch where use_rtp is set where it gets reset to FALSE.