qtdemux: fix conditions for end of segment in reverse playback
The time_position field of the stream is offset by the media_start of its QtDemuxSegment compared to the start of the GstSegment of the demuxer, take it into account when making comparisons.
Here is a test case to reproduce:
file generated with gst-launch-1.0 videotestsrc pattern=ball num-buffers=300 ! x264enc b-adapt=false key-int-max=150 ! h264parse ! mp4mux ! filesink location=/home/meh/Videos/small_ball.mp4
reverse_playback_with_stop.scenario
Run with:
gst-validate-1.0 filesrc location=/path/to/small_ball.mp4 ! qtdemux ! queue ! avdec_h264 ! videoconvert ! autovideosink --set-scenario /path/to/reverse_playback_with_stop.scenario