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 644429 - [mpegtsmux] in m2ts-mode, the tp_extra_header is incorrect
[mpegtsmux] in m2ts-mode, the tp_extra_header is incorrect
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-10 19:28 UTC by Andreas Frisch
Modified: 2011-03-26 05:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
null first two bits of timestamp before injecting into stream (744 bytes, patch)
2011-03-10 21:56 UTC, Andreas Frisch
needs-work Details | Review
[mpegtsmux] write the tp_extra_header in m2ts-mode with correct 30 bits width (1.01 KB, patch)
2011-03-21 16:19 UTC, Andreas Frisch
none Details | Review

Description Andreas Frisch 2011-03-10 19:28:18 UTC
the 4-byte-extra header prefixing ts packets in m2ts mode should actually only hold a 30 bit timestamp, the first two bits are a copy permission indicator.
Comment 1 Andreas Frisch 2011-03-10 21:56:45 UTC
Created attachment 183095 [details] [review]
null first two bits of timestamp before injecting into stream
Comment 2 Edward Hervey 2011-03-11 07:00:15 UTC
Review of attachment 183095 [details] [review]:

::: gst/mpegtsmux/mpegtsmux.c
@@ +886,3 @@
 
+          /* writing 2 bit copy permission indicator and 30 bit timestamp value */
+          GST_WRITE_UINT32_BE (GST_BUFFER_DATA (out_buf), (m2ts_pcr & 0x3FFFFFFF));

A much cleaner patch would be ensuring in the code that create m2ts_pcr that it never goes above 1 << 30.
Comment 3 Andreas Frisch 2011-03-11 11:29:42 UTC
hi ed, thanks for reviewing the patch.
m2ts_pcr needs to be continuous though because other calculations rely on it being strictly monotonic increasing
that's why i did it that way
Comment 4 Andreas Frisch 2011-03-21 16:19:12 UTC
Created attachment 183958 [details] [review]
[mpegtsmux] write the tp_extra_header in m2ts-mode with correct 30 bits width
Comment 5 Jan Schmidt 2011-03-26 05:02:44 UTC
This should fix it, please re-open if not:

commit 1c65ff19f3f22cba88ce769acc9a16ccfd0ba421
Author: Jan Schmidt <thaytan@noraisin.net>
Date:   Sat Mar 26 15:58:21 2011 +1100

    Rewrite M2TS packet output
    
    Make sure we only write the bottom 30 bits of the PCR to the m2ts header.
    Don't use floating point computation for it, and remove weird bit fiddling
    that messes up the PCR in a way I can't find any
    justification/documentation for.
    
    Don't accidentally lose PCR packets from the output.
    
    Fix the description for the m2ts-mode property so it's clear it's a flag,
    and which setting does what.
    
    Fixes: #611061 #644429
    Partially fixes: #645006