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 781008 - scaletempo: Fix GAP events handle issue when set rate
scaletempo: Fix GAP events handle issue when set rate
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.10.x
Other Linux
: Normal normal
: 1.11.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-07 07:15 UTC by Lyon
Modified: 2017-04-09 07:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for handle gap event in scaletempo (1.48 KB, patch)
2017-04-07 07:19 UTC, Lyon
none Details | Review
patch for handle gap event in scaletempo (1.60 KB, patch)
2017-04-07 08:37 UTC, Lyon
needs-work Details | Review
Updated patch for scaletempo handle gap event (1.73 KB, patch)
2017-04-07 09:42 UTC, Lyon
none Details | Review
patch for handle gap event in scaletempo update version2 (1.64 KB, patch)
2017-04-07 10:24 UTC, Lyon
committed Details | Review

Description Lyon 2017-04-07 07:15:29 UTC
This issue was found when I tried with gstplayer API in our application when I set rate to 2 with clips contain both audio and vdieo tracks, after the clip is finished, it will still not eos until time "duration x rate"  (eg. a 12s clips, when set rate to 2.0, it won't quit until 24s)

After checking in streamsychnoizer the GST_EVENT_EOS is converted to GST_EVENT_GAP, in scaletempo, it didn't modify the gap event ts and duration accrodingly with the rate.  (as in scaletempo segment.rate will be set 1.0 to keep the audio sample rate unchanged.)

Could you please have review with attached patch?

Thanks
Lyon
Comment 1 Lyon 2017-04-07 07:19:52 UTC
Created attachment 349428 [details] [review]
patch for handle gap event in scaletempo
Comment 2 Lyon 2017-04-07 08:37:12 UTC
Created attachment 349432 [details] [review]
patch for handle gap event in scaletempo
Comment 3 Sebastian Dröge (slomo) 2017-04-07 09:22:36 UTC
Review of attachment 349432 [details] [review]:

Simply scaling of the timestamp is not enough, you have to replicate the code at the bottom of gst_scaletempo_transform() here (without the latency adjustment).
Comment 4 Lyon 2017-04-07 09:42:46 UTC
Created attachment 349441 [details] [review]
Updated patch for scaletempo handle gap event

Please see updated patch with gap event timestamp adjustment
Comment 5 Sebastian Dröge (slomo) 2017-04-07 09:49:38 UTC
Review of attachment 349441 [details] [review]:

::: gst/audiofx/gstscaletempo.c
@@ +668,3 @@
+      gst_event_unref (event);
+      gap = gst_event_new_gap (gap_ts, gap_duration);
+      return gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans), gap);

Why not just fall-through here and pass the event to the base class below?
Comment 6 Lyon 2017-04-07 10:24:20 UTC
Created attachment 349450 [details] [review]
patch for handle gap event in scaletempo update version2

Please see updated patch, pass the event to base class
Comment 7 Sebastian Dröge (slomo) 2017-04-09 07:46:06 UTC
commit f26835d8bb7206c8badaeaad17342e727f3bfa75
Author: Lyon Wang <lyon.wang@nxp.com>
Date:   Fri Apr 7 15:29:43 2017 +0800

    scaletempo: Scale GAP event timestamp and duration like for buffers
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781008