GNOME Bugzilla – Bug 644429
[mpegtsmux] in m2ts-mode, the tp_extra_header is incorrect
Last modified: 2011-03-26 05:02:44 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.
Created attachment 183095 [details] [review] null first two bits of timestamp before injecting into stream
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.
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
Created attachment 183958 [details] [review] [mpegtsmux] write the tp_extra_header in m2ts-mode with correct 30 bits width
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