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 656927 - tsdemux: fix demuxing on a small sample file
tsdemux: fix demuxing on a small sample file
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-19 17:01 UTC by Vincent Penquerc'h
Modified: 2012-05-24 08:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tsdemux: do not keep a dangling pointer (1.22 KB, patch)
2011-08-19 17:01 UTC, Vincent Penquerc'h
committed Details | Review
tsdemux: do not try to compare a PCR with itself for statistics (1.86 KB, patch)
2011-08-19 17:02 UTC, Vincent Penquerc'h
committed Details | Review
tsdemux: fix failure to demux on a small sample file (1.51 KB, patch)
2011-08-19 17:02 UTC, Vincent Penquerc'h
none Details | Review

Description Vincent Penquerc'h 2011-08-19 17:01:22 UTC
I know nothing about MPEG, so I'm probably missing obvious things.
The third patch is probably not correct, and here for comments only.
Comment 1 Vincent Penquerc'h 2011-08-19 17:01:57 UTC
Created attachment 194245 [details] [review]
tsdemux: do not keep a dangling pointer

When removing the current program, it will get freed by the
hash table removal callback, so ensure we clear our pointer
to it.

Fixes a crash later on in gst_ts_demux_push trying to access it.
Comment 2 Vincent Penquerc'h 2011-08-19 17:02:03 UTC
Created attachment 194246 [details] [review]
tsdemux: do not try to compare a PCR with itself for statistics

Especially as one of the logs will cause a divide by zero.
Comment 3 Vincent Penquerc'h 2011-08-19 17:02:11 UTC
Created attachment 194247 [details] [review]
tsdemux: fix failure to demux on a small sample file

This is likely not correct, as the removal was not accidental, but
this fixes demuxing https://bugzilla.gnome.org/attachment.cgi?id=186315.
Patch not really meant for applying, but more for attracting comments
from people who know more than nothing about MPEG.
Comment 4 Vincent Penquerc'h 2011-08-19 17:04:11 UTC
There's a last problem with the sample file:
The segment duration is calculated from the difference between last and first PCRs.
Only one is found, so duration is 0.
I see nowhere in this plugin which calculates duration of a buffer though...
Comment 5 Sebastian Dröge (slomo) 2011-08-23 08:39:20 UTC
Pushed the obviously correct patches, no idea about the remaining patch though

commit 66dbdfd4d1146b7660919bdd448f35251517fe8a
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Fri Aug 19 17:28:54 2011 +0100

    tsdemux: do not try to compare a PCR with itself for statistics
    
    Especially as one of the logs will cause a divide by zero.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656927

commit b19a5ea1f3a3d928e36a1d626fb0f39614cfda99
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Fri Aug 19 13:32:14 2011 +0100

    tsdemux: do not keep a dangling pointer
    
    When removing the current program, it will get freed by the
    hash table removal callback, so ensure we clear our pointer
    to it.
    
    Fixes a crash later on in gst_ts_demux_push trying to access it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656927
Comment 6 Edward Hervey 2012-05-24 08:26:46 UTC
This now works fine with current git.