After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757520 - rtpbin: logically dead code
rtpbin: logically dead code
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-03 12:42 UTC by jihae
Modified: 2018-05-04 11:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtpbin: remove logically dead code (823 bytes, patch)
2015-11-04 04:57 UTC, jihae
reviewed Details | Review

Description jihae 2015-11-03 12:42:15 UTC
there is dead code in in gst_rtp_bin_associate().
I will attach the patch soon.
Comment 1 jihae 2015-11-04 04:57:21 UTC
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.
Comment 2 Thiago Sousa Santos 2016-03-22 15:26:11 UTC
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.
Comment 3 jihae 2016-03-23 03:03:22 UTC
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.
Comment 4 jihae 2016-03-23 03:07:13 UTC
thank you for review
Comment 5 Thiago Sousa Santos 2016-03-28 16:30:32 UTC
(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.
Comment 6 Olivier Crête 2018-05-04 11:55:05 UTC
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.