GNOME Bugzilla – Bug 796558
event: Unset SNAP flags when creating a new seek event without KEY_UNIT flag
Last modified: 2018-06-18 07:32:38 UTC
See commit message for rationale
Created attachment 372629 [details] [review] event: Unset SNAP flags when creating a new seek event without KEY_UNIT flag The SNAP flags only make sense in combination with the KEY_UNIT flag, and without they expose all kinds of unexpected behaviour in various elements that don't expect this from happening. Also warn if this ever happens.
Comment on attachment 372629 [details] [review] event: Unset SNAP flags when creating a new seek event without KEY_UNIT flag >+ /* SNAP flags only make sense in combination with the KEYUNIT flag. Warn >+ * and unset the SNAP flags if they're set without the KEYUNIT flag */ >+ if (!(flags & GST_SEEK_FLAG_KEY_UNIT) && >+ (flags & (GST_SEEK_FLAG_SNAP_BEFORE | GST_SEEK_FLAG_SNAP_AFTER | >+ GST_SEEK_FLAG_SNAP_NEAREST))) { >+ g_warn_if_fail ((flags & GST_SEEK_FLAG_KEY_UNIT) >+ || !(flags & (GST_SEEK_FLAG_SNAP_BEFORE | GST_SEEK_FLAG_SNAP_AFTER | >+ GST_SEEK_FLAG_SNAP_NEAREST))); Should we maybe just do a g_warning() with some text here? :)
(In reply to Tim-Philipp Müller from comment #2) > Should we maybe just do a g_warning() with some text here? :) I thought about that but uninventive with the text. Any suggestion? :)
"SNAP flags only make sense for KEY_UNIT seeks." (maybe + "ignoring SNAP flag"). Question is also if g_warn_if_fail() is compiled out in case of -DG_DISABLE_CHECKS or somesuch whilst g_warning may not be compiled out then.
They are not compiled out, both of them. So you would prefer that over the current one?
Created attachment 372685 [details] [review] event: Unset SNAP flags when creating a new seek event without KEY_UNIT flag The SNAP flags only make sense in combination with the KEY_UNIT flag, and without they expose all kinds of unexpected behaviour in various elements that don't expect this from happening. Also warn if this ever happens.
Let's go with this then?
Works for me, but whatever you prefer really :)
Attachment 372685 [details] pushed as 8f496b7 - event: Unset SNAP flags when creating a new seek event without KEY_UNIT flag