GNOME Bugzilla – Bug 742638
mpegpsdemux: dead code
Last modified: 2015-01-12 13:04:43 UTC
Created attachment 294149 [details] [review] original behaviour In gst/mpegdemux/gstmpegdemux.c there is a gboolean initialized to FALSE and then the only usage on found is in these two blocks a few lines below: while (found && fscr < scr) { [...] } while (found && fscr > scr && offset > 0) { [...] }
The two options are to following the original behavior [0] which was removed in the commit 7bcd991f93ea813c1b079606ab4640b6a3898742 [1]. Or keep the current behaviour which hasn't had any bugs reported since that commit 2 years ago and remove the gboolean and blocks altogether. Both options attached. [0] http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/mpegdemux/gstmpegdemux.c?id=8147669971151c33d12c645a242406e518291ff0#n1060 [1] http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=7bcd991f93ea813c1b079606ab4640b6a3898742
Created attachment 294151 [details] [review] current behaviour
[1] http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/mpegdemux/gstmpegdemux.c?id=7bcd991f93ea813c1b079606ab4640b6a3898742#n1085 Easier to read.
Comment on attachment 294151 [details] [review] current behaviour Clearly there was an intention behind this code..
Comment on attachment 294149 [details] [review] original behaviour This makes more sens to me, at least it should match the intention behind the code more closely. (There'll still be a lot of scanning if our original offset guesstimate was wrong, but that's unrelated to this change)
And you can also remove the gboolean found = FALSE at the top then I believe.
I agree. Fix submitted.
Comment on attachment 294149 [details] [review] original behaviour Thanks Tim! :)