gst-play: Fix trick-mode handling.
authorJan Schmidt <jan@centricular.com>
Fri, 21 Jan 2022 14:30:57 +0000 (01:30 +1100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 25 Feb 2022 08:07:25 +0000 (08:07 +0000)
The instant-rate value in the TrickMode enum is a
flag, but the other values are not. Move instant-rate
to the end of the enum and give it a value large enough
for it to be used without modifying the trick-mode
setting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1788>

subprojects/gst-plugins-base/tools/gst-play.c

index 508800a..66b4e8d 100644 (file)
@@ -61,8 +61,14 @@ typedef enum
   GST_PLAY_TRICK_MODE_DEFAULT_NO_AUDIO,
   GST_PLAY_TRICK_MODE_KEY_UNITS,
   GST_PLAY_TRICK_MODE_KEY_UNITS_NO_AUDIO,
-  GST_PLAY_TRICK_MODE_INSTANT_RATE,
-  GST_PLAY_TRICK_MODE_LAST
+  GST_PLAY_TRICK_MODE_LAST,
+
+  /* The instant-rate setting is a flag,
+   * applied on top of the trick-mode enum value.
+   * It needs to have a 2^n value bigger than 
+   * any of the enum values so setting it
+   * won't affect the trickmode value */
+  GST_PLAY_TRICK_MODE_INSTANT_RATE = (1 << 3)
 } GstPlayTrickMode;
 
 typedef enum