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 796480 - qtdemux: Forward upstream time-format segment without mapping
qtdemux: Forward upstream time-format segment without mapping
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-06-01 12:17 UTC by Seungha Yang
Modified: 2018-06-08 10:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtdemux: Forward upstream time-format segment without mapping (2.78 KB, patch)
2018-06-01 12:19 UTC, Seungha Yang
none Details | Review
tests: qtdemux: Add checking exposed segment event (2.22 KB, patch)
2018-06-01 14:43 UTC, Seungha Yang
none Details | Review
qtdemux: Forward upstream time-format segment without mapping (2.79 KB, patch)
2018-06-04 10:58 UTC, Seungha Yang
committed Details | Review
tests: qtdemux: Add checking exposed segment event (2.25 KB, patch)
2018-06-04 10:59 UTC, Seungha Yang
committed Details | Review

Description Seungha Yang 2018-06-01 12:17:16 UTC
Sample table based segment event (genereted by qtdemux) could break
presentation timeline. For example, qtdemux should not modify upstream
time format segment (e.g., adaptivedemux use case)
Comment 1 Seungha Yang 2018-06-01 12:19:09 UTC
Created attachment 372506 [details] [review]
qtdemux: Forward upstream time-format segment without mapping

Fix regression introduced by Bug 793058
Comment 2 Nicolas Dufresne (ndufresne) 2018-06-01 13:26:32 UTC
Can you provide a unit test to demonstrate this ? You didn't explain how you reproduced or if it breaks the issue in 793058.
Comment 3 Thibault Saunier 2018-06-01 13:47:53 UTC
(In reply to Nicolas Dufresne (ndufresne) from comment #2)
> Can you provide a unit test to demonstrate this ? You didn't explain how you
> reproduced or if it breaks the issue in 793058.

This aims at fixing currently broken DASH testcases in -validate so I would think we are already covered in term of tests.

So basically your approach is to be more restrictive in the way we decide to apply edit list or not, and not do it on all fragmented files (which was wrong) but do it only if upstream is providing time segments (I guess currently only dashdemux does that). Are you sure in the dashdemux case (upstream_format_is_time == TRUE) no edit list should ever be applied? I guess it would be good enough, but I am not 100% sure it is theoretically correct.

Now, this fixes only a part of the equation it seems, I am still getting an issue with backward playback with dash streams (basically the segment that we push doesn't have a "stop" value which is wrong), we can reproduce with:

```
GST_VALIDATE=fatal-criticals gst-validate-launcher adaptive.dash.playback.full_live_rewind.DASHIF_livestream_testpic_2s -v

...

Launching: adaptive.dash.playback.full_live_rewind.DASHIF_livestream_testpic_2s
    Command: 'GST_VALIDATE_OVERRIDE='/home/thiblahute/gst-validate/gst-integration-testsuites/medias/adaptivecontent/DASHIF_livestream_testpic_2s.override' GST_VALIDATE='fatal-criticals' GST_VALIDATE_SCENARIOS_PATH='/home/thiblahute/devel/gstreamer/gst-build/prefix/share/gstreamer-1.0/validate/scenarios:/home/thiblahute/devel/gstreamer/gst-build/subprojects/gst-devtools/validate/data/scenarios' GST_VALIDATE_SCENARIO='full_live_rewind' DISPLAY=':0' GST_GL_XINITTHREADS='1' /home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-devtools/validate/tools/gst-validate-1.0 playbin uri=http://vm2.dashif.org/livesim/testpic_2s/Manifest.mpd#t=posix:now --set-media-info /home/thiblahute/gst-validate/gst-integration-testsuites/medias/adaptivecontent/DASHIF_livestream_testpic_2s.stream_info'


=========================================
Running scenario full_live_rewind on pipeline playbin0
=========================================
Starting pipeline
Pipeline started

Start buffering
Buffering... 4%
Buffering... 99%  43:00.000000000 duration: 424405:43:08.010655555 speed: 1.000000 />
Done buffering
Executing (subaction) wait: duration=0:00:05.000000000
<position: 424405:43:04.942577920 duration: 424405:43:12.000000000 speed: 1.000000 />
full_live_rewind --> Stop waiting
  -> Action wait done (duration: 0:00:05.000497503)
Executing (subaction) seek: name=End-seek rate=-16 stop=0:00:00.000000000 stop_type=end start=0:00:00.000000000 start_type=set flags=flush+trickmode-key-units+trickmode-no-audio
0:00:09.752491103  1755 0x7f0a5c00a630 ERROR               validate gst-validate-reporter.c:195:gst_validate_report_valist: <playbin0> 2355 (critical) : g-log: We got a g_log critical issue : gst_segment_to_running_time_full: assertion 'stop != -1' failed
   warning : a serialized event received should be pushed in the same 'time' as it was received
             Detected on <h264parse0:src>
             Description : serialized events should be pushed in the same order they are received and serialized with buffers. If an event is received after a buffer with timestamp end 'X', it should be pushed right after buffers withtimestamp end 'X'

     issue : EOS events that are part of the same pipeline 'operation' should have the same seqnum
             Detected on <multiqueue0:sink_0>
             Detected on <multiqueue0:src_0>
             Detected on <qtdemux0:sink>
             Detected on <qtdemux0:audio_0>
             Detected on <multiqueue0:sink_1>
             Detected on <multiqueue1:sink_0>
             Detected on <multiqueue1:src_0>
             Detected on <multiqueue0:src_1>
             Detected on <aacparse0:sink>
             Detected on <qtdemux1:sink>
             Detected on <aacparse0:src>
             Detected on <qtdemux1:video_0>
             Detected on <multiqueue2:sink_0>
             Detected on <avdec_aac0:sink>
             Detected on <multiqueue2:src_0>
             Detected on <avdec_aac0:src>
             Detected on <h264parse0:sink>
             Detected on <h264parse0:src>
             Detected on <capsfilter0:sink>
             Detected on <capsfilter0:src>
             Detected on <avdec_h264-0:sink>
             Detected on <avdec_h264-0:src>
             Description : when events/messages are created from another event/message, they should have their seqnums set to the original event/message seqnum

   warning : received the same caps twice
             Detected on <qtdemux1:sink>
             Detected on <qtdemux0:sink>
             Detected on <avdec_h264-0:sink>
             Detected on <h264parse0:sink>
             Detected on <avdec_aac0:sink>
             Detected on <aacparse0:sink>
             Detected on <qtdemux2:sink>
             Detected on <avdec_h264-1:sink>
             Detected on <h264parse1:sink>

  critical : We got a g_log critical issue
             Detected on <playbin0>
             Details : gst_segment_to_running_time_full: assertion 'stop != -1' failed
             dotfile : no dotfile produced as GST_DEBUG_DUMP_DOT_DIR is not set.
             backtrace :
               gst_debug_get_stack_trace (gstinfo.c:2788)
               gst_validate_report_new (gst-validate-report.c:725)
               gst_validate_report_valist (gst-validate-reporter.c:186)
               gst_validate_report (gst-validate-reporter.c:303)
               g_logv (/usr/lib/libglib-2.0.so.0.5600.1:0x7f0a700f121b)
               g_log (/usr/lib/libglib-2.0.so.0.5600.1:0x7f0a700f139c)
               gst_segment_to_running_time_full (gstsegment.c:762)
               get_running_time (gstmultiqueue.c:425)
               gst_multi_queue_loop (gstmultiqueue.c:1822)
               gst_task_func (gsttask.c:332)
               ?? (/usr/lib/libglib-2.0.so.0.5600.1:0x7f0a7011345f)
               ?? (/usr/lib/libglib-2.0.so.0.5600.1:0x7f0a70112a26)
               start_thread (/usr/lib/libpthread-2.27.so:0x7f0a6f893071)
               __clone (/usr/lib/libc-2.27.so:0x7f0a6f5c853b)




==== Got criticals. Return value set to 18 ====
     Critical error gst_segment_to_running_time_full: assertion 'stop != -1' failed

Issues found: 4

** (process:1755): ERROR (recursed) **: Fatal report received: 0:00:09.705322833 <playbin0>: 2355 (critical) : g-log: We got a g_log critical issue: gst_segment_to_running_time_full: assertion 'stop != -1' failed

== Stack trace: ==
           PID: 1755 (gst-validate-1.)
           UID: 1000 (thiblahute)
           GID: 1000 (thiblahute)
        Signal: 6 (ABRT)
     Timestamp: Fri 2018-06-01 09:43:20 -04 (2s ago)
  Command Line: /home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-devtools/validate/tools/gst-validate-1.0 playbin uri=http://vm2.dashif.org/livesim/testpic_2s/Manifest.mpd#t=posix:now --set-media-info /home/thiblahute/gst-validate/gst-integration-testsuites/medias/adaptivecontent/DASHIF_livestream_testpic_2s.stream_info
    Executable: /home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-devtools/validate/tools/gst-validate-1.0
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (thiblahute)
       Boot ID: 8abd2e499a554463ba4b254cb4fccd65
    Machine ID: ffd878768d2a46fead9f00faf1de26a2
      Hostname: thiblahute
       Storage: /var/lib/systemd/coredump/core.gst-validate-1\x2e.1000.8abd2e499a554463ba4b254cb4fccd65.1755.1527860600000000.lz4
       Message: Process 1755 (gst-validate-1.) of user 1000 dumped core.

                Stack trace of thread 1765:
                #0  0x00007f0a6f50686b raise (libc.so.6)
                #1  0x00007f0a6f4f140e abort (libc.so.6)
                #2  0x00007f0a700efee5 n/a (libglib-2.0.so.0)
                #3  0x00007f0a700f123d g_logv (libglib-2.0.so.0)
                #4  0x00007f0a700f13a0 g_log (libglib-2.0.so.0)
                #5  0x00007f0a70703777 n/a (/home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-devtools/validate/gst/validate/libgstvalidate-1.0.so.0.1500.0)

Thread apply all bt:

GNU gdb (GDB) 8.0.1
               Copyright (C) 2017 Free Software Foundation, Inc.
               License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
               This is free software: you are free to change and redistribute it.
               There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
               and "show warranty" for details.
               This GDB was configured as "x86_64-pc-linux-gnu".
               Type "show configuration" for configuration details.
               For bug reporting instructions, please see:
               <http://www.gnu.org/software/gdb/bugs/>.
               Find the GDB manual and other documentation resources online at:
               <http://www.gnu.org/software/gdb/documentation/>.
               For help, type "help".
               Type "apropos word" to search for commands related to "word"...
               Reading symbols from /home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-devtools/validate/tools/gst-validate-1.0...done.

               warning: core file may not match specified executable file.
               [New LWP 1765]
               [New LWP 1805]
               [New LWP 1804]
               [New LWP 1797]
               [New LWP 1756]
               [New LWP 1806]
               [New LWP 1755]
               [New LWP 1757]
               [New LWP 1761]
               [New LWP 1759]
               [New LWP 1767]
               [New LWP 1760]
               [New LWP 1801]
               [New LWP 1792]
               [New LWP 1763]
               [New LWP 1762]
               [New LWP 1774]
               [New LWP 1771]
               [New LWP 1772]
               [New LWP 1770]
               [New LWP 1798]
               [New LWP 1793]
               [New LWP 1769]
               [New LWP 1803]
               [New LWP 1773]
               [New LWP 1802]
               [New LWP 1800]
               [New LWP 1775]
               [New LWP 1807]
               [Thread debugging using libthread_db enabled]
               Using host libthread_db library "/usr/lib/libthread_db.so.1".
               Core was generated by `/home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-devtools/valid'.
               Program terminated with signal SIGABRT, Aborted.
               #0  0x00007f0a6f50686b in raise () from /usr/lib/libc.so.6
               [Current thread is 1 (Thread 0x7f0a48ae7700 (LWP 1765))]

               Thread 29 (Thread 0x7f09ea7fc700 (LWP 1807)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 28 (Thread 0x7f09f0e4a700 (LWP 1775)):
               #0  0x00007f0a6f89ce00 in nanosleep () at /usr/lib/libpthread.so.0
               #1  0x00007f0a701141b1 in g_usleep () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f09f105c20f in gst_xv_image_sink_event_thread (xvimagesink=0x7f0a100335f0) at ../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c:586
               #3  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #5  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 27 (Thread 0x7f09e87f8700 (LWP 1800)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 26 (Thread 0x7f09e97fa700 (LWP 1802)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 25 (Thread 0x7f0a27fff700 (LWP 1773)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a7013152d in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700bc903 in  () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a70113436 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 24 (Thread 0x7f09e9ffb700 (LWP 1803)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 23 (Thread 0x7f0a367fc700 (LWP 1769)):
               #0  0x00007f0a6f5bdea9 in poll () at /usr/lib/libc.so.6
               #1  0x00007f0a6dbd0310 in  () at /usr/lib/libresolv.so.2
               #2  0x00007f0a6dbcdd9d in __res_context_query () at /usr/lib/libresolv.so.2
               #3  0x00007f0a6dbce3b9 in  () at /usr/lib/libresolv.so.2
               #4  0x00007f0a6dbce9ad in __res_context_search () at /usr/lib/libresolv.so.2
               #5  0x00007f0a4b76bc59 in _nss_dns_gethostbyname4_r () at /usr/lib/libnss_dns.so.2
               #6  0x00007f0a6f5b2352 in gaih_inet.constprop () at /usr/lib/libc.so.6
               #7  0x00007f0a6f5b3394 in getaddrinfo () at /usr/lib/libc.so.6
               #8  0x00007f0a6fb39f31 in  () at /usr/lib/libgio-2.0.so.0
               #9  0x00007f0a6fb36e39 in  () at /usr/lib/libgio-2.0.so.0
               #10 0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #11 0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #12 0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #13 0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 22 (Thread 0x7f09e6db6700 (LWP 1793)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a51e23f2f in gst_queue_loop (pad=<optimized out>) at ../subprojects/gstreamer/plugins/elements/gstqueue.c:1525
               #3  0x00007f0a7046a981 in gst_task_func (task=0x7f0a3800eef0) at ../subprojects/gstreamer/gst/gsttask.c:332
               #4  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #6  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #7  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 21 (Thread 0x7f0a37fff700 (LWP 1798)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a7013152d in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700bc903 in  () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a70113436 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 20 (Thread 0x7f0a35ffb700 (LWP 1770)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a7013152d in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700bc903 in  () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a70113436 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 19 (Thread 0x7f0a34bc9700 (LWP 1772)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a7013152d in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700bc903 in  () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a70113436 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 18 (Thread 0x7f0a353ca700 (LWP 1771)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a7013152d in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700bc903 in  () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a70113436 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 17 (Thread 0x7f0a25ebf700 (LWP 1774)):
               #0  0x00007f0a6f5bdea9 in poll () at /usr/lib/libc.so.6
               #1  0x00007f0a26f48773 in  () at /usr/lib/libpulse.so.0
               #2  0x00007f0a26f39bd0 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
               #3  0x00007f0a26f3a271 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
               #4  0x00007f0a26f3a301 in pa_mainloop_run () at /usr/lib/libpulse.so.0
               #5  0x00007f0a26f486ae in  () at /usr/lib/libpulse.so.0
               #6  0x00007f0a26ce781c in  () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
               #7  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #8  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 16 (Thread 0x7f0a4a2ea700 (LWP 1762)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a4b119404 in gst_adaptive_demux_wait_until (clock=0x7f0a4c406180, cond=0x7f0a4c6400b8, mutex=0x7f0a4c6400b0, end_time=end_time@entry=5037904858791) at ../subprojects/gst-plugins-bad/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:4555
               #3  0x00007f0a4b11ec5c in gst_adaptive_demux_updates_loop (demux=0x7f0a4c640150) at ../subprojects/gst-plugins-bad/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:4001
               #4  0x00007f0a7046a981 in gst_task_func (task=0x5594462d6830) at ../subprojects/gstreamer/gst/gsttask.c:332
               #5  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #6  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #7  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #8  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 15 (Thread 0x7f0a49ae9700 (LWP 1763)):
               #0  0x00007f0a6f5bdfa6 in ppoll () at /usr/lib/libc.so.6
               #1  0x00007f0a7044b8ca in gst_poll_wait (set=0x7f0a4c522ad0, timeout=timeout@entry=1792977701671) at ../subprojects/gstreamer/gst/gstpoll.c:1370
               #2  0x00007f0a70463a04 in gst_system_clock_id_wait_jitter_unlocked (clock=clock@entry=0x7f0a4c406180, entry=entry@entry=0x7f0a44009600, jitter=jitter@entry=0x0, restart=restart@entry=0) at ../subprojects/gstreamer/gst/gstsystemclock.c:730
               #3  0x00007f0a70464253 in gst_system_clock_async_thread (clock=0x7f0a4c406180) at ../subprojects/gstreamer/gst/gstsystemclock.c:488
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 14 (Thread 0x7f09e7bcf700 (LWP 1792)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a51e23f2f in gst_queue_loop (pad=<optimized out>) at ../subprojects/gstreamer/plugins/elements/gstqueue.c:1525
               #3  0x00007f0a7046a981 in gst_task_func (task=0x7f0a3800edd0) at ../subprojects/gstreamer/gst/gsttask.c:332
               #4  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #6  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #7  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 13 (Thread 0x7f09e8ff9700 (LWP 1801)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 12 (Thread 0x7f0a51de6700 (LWP 1760)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a7046ab7b in gst_task_func (task=0x5594462d6290) at ../subprojects/gstreamer/gst/gsttask.c:317
               #3  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 11 (Thread 0x7f0a377fe700 (LWP 1767)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a6d4af67b in _gst_data_queue_wait_non_empty (queue=queue@entry=0x7f0a3800c210) at ../subprojects/gstreamer/libs/gst/base/gstdataqueue.c:554
               #3  0x00007f0a6d4b0cf0 in gst_data_queue_pop (queue=0x7f0a3800c210, item=item@entry=0x7f0a377fdd60) at ../subprojects/gstreamer/libs/gst/base/gstdataqueue.c:596
               #4  0x00007f0a51e11c31 in gst_multi_queue_loop (pad=<optimized out>) at ../subprojects/gstreamer/plugins/elements/gstmultiqueue.c:1809
               #5  0x00007f0a7046a981 in gst_task_func (task=0x7f0a3800e170) at ../subprojects/gstreamer/gst/gsttask.c:332
               #6  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #7  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #8  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #9  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 10 (Thread 0x7f0a6a427700 (LWP 1759)):
               #0  0x00007f0a6f5bdea9 in poll () at /usr/lib/libc.so.6
               #1  0x00007f0a700ea523 in  () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700ea8e2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a6fb7a348 in  () at /usr/lib/libgio-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 9 (Thread 0x7f0a4aaeb700 (LWP 1761)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a6fb36b4c in g_task_run_in_thread_sync () at /usr/lib/libgio-2.0.so.0
               #3  0x00007f0a6fb39c24 in  () at /usr/lib/libgio-2.0.so.0
               #4  0x00007f0a6fb1f93d in g_resolver_lookup_by_name () at /usr/lib/libgio-2.0.so.0
               #5  0x00007f0a594ed9d0 in  () at /usr/lib/libsoup-2.4.so.1
               #6  0x00007f0a594eed8b in  () at /usr/lib/libsoup-2.4.so.1
               #7  0x00007f0a6fb1e090 in  () at /usr/lib/libgio-2.0.so.0
               #8  0x00007f0a6fb2d5f7 in g_socket_client_connect () at /usr/lib/libgio-2.0.so.0
               #9  0x00007f0a59528adb in  () at /usr/lib/libsoup-2.4.so.1
               #10 0x00007f0a594fed80 in  () at /usr/lib/libsoup-2.4.so.1
               #11 0x00007f0a5952454c in  () at /usr/lib/libsoup-2.4.so.1
               #12 0x00007f0a595252c2 in soup_session_send () at /usr/lib/libsoup-2.4.so.1
               #13 0x00007f0a5979e1f5 in gst_soup_http_src_send_message (src=0x7f0a2800a0e0) at ../subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c:1530
               #14 0x00007f0a5979e1f5 in gst_soup_http_src_do_request (src=src@entry=0x7f0a2800a0e0, method=<optimized out>) at ../subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c:1603
               #15 0x00007f0a597a08ef in gst_soup_http_src_create (psrc=<optimized out>, outbuf=0x7f0a4aaeac28) at ../subprojects/gst-plugins-good/ext/soup/gstsouphttpsrc.c:1803
               #16 0x00007f0a6d497adf in gst_base_src_get_range (src=src@entry=0x7f0a2800a0e0, offset=offset@entry=0, length=<optimized out>, buf=buf@entry=0x7f0a4aaead08) at ../subprojects/gstreamer/libs/gst/base/gstbasesrc.c:2512
               #17 0x00007f0a6d499b42 in gst_base_src_loop (pad=0x7f0a08159440) at ../subprojects/gstreamer/libs/gst/base/gstbasesrc.c:2836
               #18 0x00007f0a7046a981 in gst_task_func (task=0x5594462d63b0) at ../subprojects/gstreamer/gst/gsttask.c:332
               #19 0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #20 0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #21 0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #22 0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 8 (Thread 0x7f0a62aa6700 (LWP 1757)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a51e23f2f in gst_queue_loop (pad=<optimized out>) at ../subprojects/gstreamer/plugins/elements/gstqueue.c:1525
               #3  0x00007f0a7046a981 in gst_task_func (task=0x7f0a0814db90) at ../subprojects/gstreamer/gst/gsttask.c:332
               #4  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #6  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #7  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 7 (Thread 0x7f0a70b1bc40 (LWP 1755)):
               #0  0x00007f0a6f5bdea9 in poll () at /usr/lib/libc.so.6
               #1  0x00007f0a700ea523 in  () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700ea8e2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
               #3  0x0000559444e67e1f in main (argc=<optimized out>, argv=<optimized out>) at ../subprojects/gst-devtools/validate/tools/gst-validate.c:524

               Thread 6 (Thread 0x7f09eaffd700 (LWP 1806)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 5 (Thread 0x7f0a6b2a7700 (LWP 1756)):
               #0  0x00007f0a6f5bdea9 in poll () at /usr/lib/libc.so.6
               #1  0x00007f0a700ea523 in  () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a700ea63e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a700ea692 in  () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #6  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 4 (Thread 0x7f0a492e8700 (LWP 1797)):
               #0  0x00007f0a6f5c30f9 in syscall () at /usr/lib/libc.so.6
               #1  0x00007f0a70131411 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
               #2  0x00007f0a4b11f573 in gst_adaptive_demux_stream_download_uri (demux=demux@entry=0x7f0a4c640150, stream=stream@entry=0x5594461cac00, uri=uri@entry=0x7f0a3000b630 "http://vm2.dashif.org/livesim/testpic_2s/V300/763930297.m4s", start=start@entry=0, end=<optimized out>, end@entry=8191, http_status=http_status@entry=0x7f0a492e7d54) at ../subprojects/gst-plugins-bad/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:3204
               #3  0x00007f0a4b1221a8 in gst_adaptive_demux_stream_download_fragment (stream=0x5594461cac00) at ../subprojects/gst-plugins-bad/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:3386
               #4  0x00007f0a4b1221a8 in gst_adaptive_demux_stream_download_loop (stream=0x5594461cac00) at ../subprojects/gst-plugins-bad/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:3753
               #5  0x00007f0a7046a981 in gst_task_func (task=0x7f0a4c40da70) at ../subprojects/gstreamer/gst/gsttask.c:332
               #6  0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #7  0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #8  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #9  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 3 (Thread 0x7f09ebfff700 (LWP 1804)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 2 (Thread 0x7f09eb7fe700 (LWP 1805)):
               #0  0x00007f0a6f898ffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
               #1  0x00007f09f6ee376f in  () at /usr/lib/libavcodec.so.58
               #2  0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #3  0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6

               Thread 1 (Thread 0x7f0a48ae7700 (LWP 1765)):
               #0  0x00007f0a6f50686b in raise () at /usr/lib/libc.so.6
               #1  0x00007f0a6f4f140e in abort () at /usr/lib/libc.so.6
               #2  0x00007f0a700efee5 in  () at /usr/lib/libglib-2.0.so.0
               #3  0x00007f0a700f123d in g_logv () at /usr/lib/libglib-2.0.so.0
               #4  0x00007f0a700f13a0 in g_log () at /usr/lib/libglib-2.0.so.0
               #5  0x00007f0a70703777 in gst_validate_report_valist (reporter=<optimized out>, issue_id=<optimized out>, format=<optimized out>, var_args=var_args@entry=0x7f0a48ae6a00) at ../subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c:248
               #6  0x00007f0a707038bf in gst_validate_report (reporter=<optimized out>, issue_id=<optimized out>, format=<optimized out>) at ../subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c:303
               #7  0x00007f0a700f121f in g_logv () at /usr/lib/libglib-2.0.so.0
               #8  0x00007f0a700f13a0 in g_log () at /usr/lib/libglib-2.0.so.0
               #9  0x00007f0a7045b5c2 in gst_segment_to_running_time_full (segment=<optimized out>, format=format@entry=GST_FORMAT_TIME, position=<optimized out>, running_time=running_time@entry=0x7f0a48ae6cb0) at ../subprojects/gstreamer/gst/gstsegment.c:762
               #10 0x00007f0a51e1190e in my_segment_to_running_time (val=<optimized out>, segment=<optimized out>) at ../subprojects/gstreamer/plugins/elements/gstmultiqueue.c:424
               #11 0x00007f0a51e1190e in get_running_time (segment=segment@entry=0x7f0a2c011ca8, object=object@entry=0x7f0a30005590, end=end@entry=0) at ../subprojects/gstreamer/plugins/elements/gstmultiqueue.c:1605
               #12 0x00007f0a51e11c93 in gst_multi_queue_loop (pad=<optimized out>) at ../subprojects/gstreamer/plugins/elements/gstmultiqueue.c:1822
               #13 0x00007f0a7046a981 in gst_task_func (task=0x7f0a380304d0) at ../subprojects/gstreamer/gst/gsttask.c:332
               #14 0x00007f0a70113463 in  () at /usr/lib/libglib-2.0.so.0
               #15 0x00007f0a70112a2a in  () at /usr/lib/libglib-2.0.so.0
               #16 0x00007f0a6f893075 in start_thread () at /usr/lib/libpthread.so.0
               #17 0x00007f0a6f5c853f in clone () at /usr/lib/libc.so.6
```
Comment 4 Alicia Boya García 2018-06-01 13:54:53 UTC
Review of attachment 372506 [details] [review]:

::: gst/isomp4/qtdemux.c
@@ +6908,3 @@
+            /* Forward upstream driven time format segment, and also do not try
+             * to map edit list with the upstream time format segment.
+             * It's upstream element's role (the origin of time format segment)

It's not upstream element's role to map edit lists at all. A proper implementation should never emit unmapped segments downstream. But there are bugs that prevent that from working, so if it makes the tests pass again, even if it's wrong, I'm fine with it -- ideally as a temporary solution.
Comment 5 Seungha Yang 2018-06-01 14:02:29 UTC
(In reply to Alicia Boya García from comment #4)
> Review of attachment 372506 [details] [review] [review]:
> 
> ::: gst/isomp4/qtdemux.c
> @@ +6908,3 @@
> +            /* Forward upstream driven time format segment, and also do not
> try
> +             * to map edit list with the upstream time format segment.
> +             * It's upstream element's role (the origin of time format
> segment)
> 
> It's not upstream element's role to map edit lists at all. A proper
> implementation should never emit unmapped segments downstream. But there are
> bugs that prevent that from working, so if it makes the tests pass again,
> even if it's wrong, I'm fine with it -- ideally as a temporary solution.

IMHO, time format segment should not be modified by demuxer since there must be 
 some reason (period change and etc) why upstream element set it. This can break multi-period use case also. As far as I know, edit list in dash stream is restricted, but if there are, dashdemux should parse edit list (dashdemux is already parsing some atoms such as moof, sidx) using isoff parser.
Comment 6 Seungha Yang 2018-06-01 14:26:11 UTC
Specification ISO/IEC 23009-1 (Second edition) defines no restriction on edit list, but not sure whether other amendments are redefining it.

And DASHIF recommendation (yes, it not spec, but broadly referenced) is saying that,

6.2.5.2 Bitstream switching
```
The @presentationTimeOffset attribute shall be sufficient to align audio video,
subtitle, and presentation timelines at presentation a Period’s presentation start time. Any edit lists present in Initialization Segments shall be ignored. It is strongly recommended that the Presentation Time Offset at the start of each Period coincide with the first frame of a Segment to improve decoding continuity at the start of Periods.
```
Comment 7 Seungha Yang 2018-06-01 14:43:44 UTC
Created attachment 372512 [details] [review]
tests: qtdemux: Add checking exposed segment event
Comment 8 Thibault Saunier 2018-06-01 15:39:44 UTC
Review of attachment 372512 [details] [review]:

This doesn't test so much, but ok.

BTW, we are working on precise segment check tests (in validate) for different use cases.

::: tests/check/elements/qtdemux.c
@@ -36,1 +36,9 @@
-  GstBuffer *buf = GST_PAD_PROBE_INFO_BUFFER (info);
+  if (GST_IS_EVENT (GST_PAD_PROBE_INFO_DATA (info))) {
+    GstEvent *ev = GST_PAD_PROBE_INFO_EVENT (info);
+
... 6 more ...

Better use GST_CLOCK_TIME_IS_VALID.
Comment 9 Thibault Saunier 2018-06-01 16:54:32 UTC
So, after checking a bit more what happened with the latest landed patches I noticed that the backward playback on dash breakage comes from Bug #752603 (Segment handling rework) and not Bug 793058, so that part is out of scope for that particular patch fmpov.
Comment 10 Alicia Boya García 2018-06-01 17:00:17 UTC
(In reply to Thibault Saunier from comment #3)
> Now, this fixes only a part of the equation it seems, I am still getting an
> issue with backward playback with dash streams (basically the segment that
> we push doesn't have a "stop" value which is wrong)

Hint: the segment is pushed to qtdemux with a stop value. The problem is that it's being modified later by qtdemux_parse_tree() while parsing the moov. This is the offending line:

qtdemux->segment.stop = duration;
Comment 11 Seungha Yang 2018-06-04 10:58:47 UTC
Created attachment 372539 [details] [review]
qtdemux: Forward upstream time-format segment without mapping

Change to use gst_qtdemux_check_send_pending_segment() instead of gst_qtdemux_push_pending_newsegment() in order to
- Push tag events
- Push gap events for sparse streams
Comment 12 Seungha Yang 2018-06-04 10:59:17 UTC
Created attachment 372540 [details] [review]
tests: qtdemux: Add checking exposed segment event
Comment 13 Thibault Saunier 2018-06-06 15:57:17 UTC
Comment on attachment 372539 [details] [review]
qtdemux: Forward upstream time-format segment without mapping

commit 6b29a4507eb6d73ba350a26558a8e8a267998ab2
Author: Seungha Yang <seungha.yang@navercorp.com>
Date:   Fri Jun 1 21:08:10 2018 +0900

    qtdemux: Forward upstream time-format segment without mapping

    Sample table based segment event (genereted by qtdemux) could break
    presentation timeline. For example, qtdemux should not modify upstream
    time format segment (e.g., adaptivedemux use case)

    https://bugzilla.gnome.org/show_bug.cgi?id=796480
Comment 14 Thibault Saunier 2018-06-06 15:58:10 UTC
Comment on attachment 372540 [details] [review]
tests: qtdemux: Add checking exposed segment event

commit aecc17251da1438f5b829729aab39c529672494f
Author: Seungha Yang <seungha.yang@navercorp.com>
Date:   Fri Jun 1 22:47:10 2018 +0900

    tests: qtdemux: Add checking exposed segment event

    https://bugzilla.gnome.org/show_bug.cgi?id=796480

Pushed with a minor change to not drop events in the probe (keeping previous behaviour)