mpegtsdemux: Don't pretend doing NAL alignment
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 10 Oct 2018 18:36:57 +0000 (18:36 +0000)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 14 Apr 2020 15:36:16 +0000 (11:36 -0400)
commit4a91a98ea1bd5c599f67c5227b60ef01bbe3b860
treee75c939626d90cdf01581a7af327f545887787cc
parent462a8130a6cc3e1ae455cae1a4e09f73984a124a
mpegtsdemux: Don't pretend doing NAL alignment

Per specification in 2.14.2 "For PES packetization, no specific data
alignment constraints apply". So we should not advertise NAL
alignment.

This bug was introduced at the same moment the alignment field was introduced
10 years ago. The plan was that alignment=none (or no alignment field) was to
be used for mpegtsdemux, but no one noticed the error. The reason is that at
the same moment, everything dealing with H264 started defaulting to AU
alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=606662#c22

This patch will have a side effect that a parser is now needed after the
tsdemux element. The following pipeline will not negotiate anymore as the
mpegtsmux element requires alignment={nal,au}.

  ... ! tsdemux ! mpegtsmux ! ...

As a side effect, anyone that forked from tsdemux should updated their code to
fix this bug.
gst/mpegtsdemux/tsdemux.c