GNOME Bugzilla – Bug 781393
tsdemux: fix to keep seqnum of segment
Last modified: 2018-11-03 14:07:21 UTC
I tried to seek on hls stream, here is the url : https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8 Hlsdemux handled the seek event and generated relevant flush-start/stop and segment event, but the tsdemux didn't keep the seqnum of segment which receiving event from hlsdemux in this case. So I fixed to keep seqnum of segment in tsdemux for this.
Created attachment 349932 [details] [review] tsdemux: fix to keep seqnum of segment
Review of attachment 349932 [details] [review]: ::: gst/mpegtsdemux/mpegtsbase.c @@ +203,2 @@ gst_segment_init (&base->segment, GST_FORMAT_UNDEFINED); + base->segment_seqnum = (guint32) 0; Why the cast? @@ +216,3 @@ GST_DEBUG_OBJECT (base, "Streams aware : %d", base->streams_aware); + base->segment_seqnum = 0; Why are you setting it to 0 twice? ::: gst/mpegtsdemux/tsdemux.c @@ +1721,3 @@ + if (base->segment_seqnum) { + gst_event_set_seqnum (event, base->segment_seqnum); + base->segment_seqnum = 0; Why do you reset it to 0? And there are other places in tsdemux and mpegtsbase where EOS events are send @@ +2379,3 @@ if (!demux->segment_event) { demux->segment_event = gst_event_new_segment (&demux->segment); + GST_EVENT_SEQNUM (demux->segment_event) = base->segment_seqnum; gst_event_set_seqnum()
Created attachment 350105 [details] [review] tsdemux: fix to keep seqnum of segment #2 I made some mistakes, fixed it and added to set seqnum when generating EOS event in tsdemux also, thanks!
Created attachment 350113 [details] [review] tsdemux: fix to keep seqnum of segment #3 oops, I pushed the wrong patch, updated it
Review of attachment 350113 [details] [review]: Definitely good and needed. Only nitpick. Could you use GST_SEQNUM_INVALID for initialization and checking whether it is valid ? This makes the code clearer. And could you rebase it against current master ? Thanks !
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/546.