diff mbox series

[FFmpeg-devel] avformat/mpegtsenc: Dont include adaptation field in teletext TS packets.

Message ID 20211021145802.1258420-1-alexthreed@gmail.com
State New
Headers show
Series [FFmpeg-devel] avformat/mpegtsenc: Dont include adaptation field in teletext TS packets. | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Alex Shumsky Oct. 21, 2021, 2:58 p.m. UTC
From ETSI EN 300 472 V1.3.1 (2003-05) Specification for conveying ITU-R System B Teletext in DVB bitstreams:
4.1 Transport Stream (TS) packet format
The standard TS packet syntax and semantics are followed, noting the following constraint:
- adaptation_field_control only the values "01" and "10" are permitted.

Some set top boxes (Motorola, Arris, Zyxel) refuse non-conforming packets.

Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
---
 libavformat/mpegtsenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Marton Balint Nov. 6, 2021, 7:35 p.m. UTC | #1
On Thu, 21 Oct 2021, Alex Shumsky wrote:

>> From ETSI EN 300 472 V1.3.1 (2003-05) Specification for conveying ITU-R System B Teletext in DVB bitstreams:
> 4.1 Transport Stream (TS) packet format
> The standard TS packet syntax and semantics are followed, noting the following constraint:
> - adaptation_field_control only the values "01" and "10" are permitted.
>
> Some set top boxes (Motorola, Arris, Zyxel) refuse non-conforming packets.
>
> Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
> ---
> libavformat/mpegtsenc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 184bb52f75..3d630e2500 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -1564,7 +1564,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
>             q = get_ts_payload_start(buf);
>             ts_st->discontinuity = 0;
>         }
> -        if (key && is_start && pts != AV_NOPTS_VALUE) {
> +        if (key && is_start && pts != AV_NOPTS_VALUE
> +            && !is_dvb_teletext /* adaptation+payload forbidden for teletext (ETSI EN 300 472 V1.3.1 4.1) */ ) {
>             // set Random Access for key frames
>             if (ts_st->pcr_period)
>                 write_pcr = 1;

Thanks, will apply.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 184bb52f75..3d630e2500 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1564,7 +1564,8 @@  static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
             q = get_ts_payload_start(buf);
             ts_st->discontinuity = 0;
         }
-        if (key && is_start && pts != AV_NOPTS_VALUE) {
+        if (key && is_start && pts != AV_NOPTS_VALUE
+            && !is_dvb_teletext /* adaptation+payload forbidden for teletext (ETSI EN 300 472 V1.3.1 4.1) */ ) {
             // set Random Access for key frames
             if (ts_st->pcr_period)
                 write_pcr = 1;