GNOME Bugzilla – Bug 611895
Check return value of functions
Last modified: 2010-03-24 17:55:34 UTC
Created attachment 155299 [details] [review] Patch that fixes this When calling gst_structure_get_clock_time in file gstbasertpdepayload.c return values are not checked
Review of attachment 155299 [details] [review]: It shouldn't be necessary. If they get functions fail, the timestamp/duration variables are not modified.
Review of attachment 155299 [details] [review]: I know, but this way you have two assignments less in the case the functions doesn't fail.
But you have a condition instead, I'm not sure what the gain is.
In theory is a good practice to check the return value of every function, so do the test for the return value and use it for something useful. Also apart of doing the assignment maybe would be good to put a warning.
Since there's no real bug being fixed here, I don't see the point in touching the code for no other reason than minor style issues. The way the getters are used here seems fine to me, and if that's the preference of the people maintaining the code, let's keep it that way. (If anyone ever changes this code, they may want to check against GST_CLOCK_TIME_NONE rather than -1 as well btw ;)).