diff mbox

[FFmpeg-devel] lavf/mpegtsenc: Set min PID for data pkt to 0x0010

Message ID 201609241206.07073.cehoyos@ag.or.at
State Accepted
Commit 58776ccbdb4d2e5f07d1d0fe12a1529cffe949c0
Headers show

Commit Message

Carl Eugen Hoyos Sept. 24, 2016, 10:06 a.m. UTC
Hi!

Attached patch fixes ticket #1673.
ISO13818-1 indeed specifies in §2.4.3.3 that values 
up to 0xF are reserved.

Please comment, Carl Eugen
From 06371416c00eaf73430d1bb7d841167356adbe23 Mon Sep 17 00:00:00 2001
From: Sylvain Laurent <syllaur@gmail.com>
Date: Sat, 24 Sep 2016 12:01:34 +0200
Subject: [PATCH] lavf/mpegtsenc: Set min PID for data pkt to 0x0010.

Fixes ticket #1673.
---
 libavformat/mpegtsenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Sept. 27, 2016, 1:41 a.m. UTC | #1
On Sat, Sep 24, 2016 at 12:06:07PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #1673.
> ISO13818-1 indeed specifies in §2.4.3.3 that values 
> up to 0xF are reserved.
> 
> Please comment, Carl Eugen

>  mpegtsenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 60a99310ff7b9ef476fa1d70bb01ffcaaf550226  0001-lavf-mpegtsenc-Set-min-PID-for-data-pkt-to-0x0010.patch
> From 06371416c00eaf73430d1bb7d841167356adbe23 Mon Sep 17 00:00:00 2001
> From: Sylvain Laurent <syllaur@gmail.com>
> Date: Sat, 24 Sep 2016 12:01:34 +0200
> Subject: [PATCH] lavf/mpegtsenc: Set min PID for data pkt to 0x0010.
> 
> Fixes ticket #1673.
> ---
>  libavformat/mpegtsenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index fd849e5..c10a3bf 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -1843,7 +1843,7 @@ static const AVOption options[] = {
>        { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
>      { "mpegts_start_pid", "Set the first pid.",
>        offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT,
> -      { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> +      { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
>      { "mpegts_m2ts_mode", "Enable m2ts mode.",

the previous limit was set by Zach Swena (in CC)
was there a reason why it was 0x20 and not 0x10 ?

Thanks

[...]
Andrey Turkin Sept. 27, 2016, 3:24 a.m. UTC | #2
ISO 18318 reserves PIDs 0x00-0x0F
DVB also reserves PIDs 0x10-0x1F
ARIB also reserves PIDs 0x20-0x2F
ATSC also reserves PID 0x1FFB

So, if there is going to be change to permitted PIDs assignment anyway, I
suggest to go with safest choice and use 0x0030-0x1FEF range

2016-09-27 4:41 GMT+03:00 Michael Niedermayer <michael@niedermayer.cc>:

> On Sat, Sep 24, 2016 at 12:06:07PM +0200, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > Attached patch fixes ticket #1673.
> > ISO13818-1 indeed specifies in §2.4.3.3 that values
> > up to 0xF are reserved.
> >
> > Please comment, Carl Eugen
>
> >  mpegtsenc.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 60a99310ff7b9ef476fa1d70bb01ffcaaf550226  0001-lavf-mpegtsenc-Set-min-
> PID-for-data-pkt-to-0x0010.patch
> > From 06371416c00eaf73430d1bb7d841167356adbe23 Mon Sep 17 00:00:00 2001
> > From: Sylvain Laurent <syllaur@gmail.com>
> > Date: Sat, 24 Sep 2016 12:01:34 +0200
> > Subject: [PATCH] lavf/mpegtsenc: Set min PID for data pkt to 0x0010.
> >
> > Fixes ticket #1673.
> > ---
> >  libavformat/mpegtsenc.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> > index fd849e5..c10a3bf 100644
> > --- a/libavformat/mpegtsenc.c
> > +++ b/libavformat/mpegtsenc.c
> > @@ -1843,7 +1843,7 @@ static const AVOption options[] = {
> >        { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
> >      { "mpegts_start_pid", "Set the first pid.",
> >        offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT,
> > -      { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> > +      { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> >      { "mpegts_m2ts_mode", "Enable m2ts mode.",
>
> the previous limit was set by Zach Swena (in CC)
> was there a reason why it was 0x20 and not 0x10 ?
>
> Thanks
>
> [...]
>
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Never trust a computer, one day, it may think you are the virus. -- Compn
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
Andrey Turkin Sept. 27, 2016, 3:42 a.m. UTC | #3
Nevermind, I didn't though this through. Default value is high enough to
comply with all standards.  If someone really wants/needs to use 0x0010 as
PMT/data pids then it should be permitted since it is permitted by
13818-1:2000. By the same logic upper limit should be set to 0x1FFE. Though
it would be good if someone with an access to later versions of the
standard could verify if these limits are still the same.

2016-09-27 6:24 GMT+03:00 Andrey Turkin <andrey.turkin@gmail.com>:

> ISO 18318 reserves PIDs 0x00-0x0F
> DVB also reserves PIDs 0x10-0x1F
> ARIB also reserves PIDs 0x20-0x2F
> ATSC also reserves PID 0x1FFB
>
> So, if there is going to be change to permitted PIDs assignment anyway, I
> suggest to go with safest choice and use 0x0030-0x1FEF range
>
> 2016-09-27 4:41 GMT+03:00 Michael Niedermayer <michael@niedermayer.cc>:
>
>> On Sat, Sep 24, 2016 at 12:06:07PM +0200, Carl Eugen Hoyos wrote:
>> > Hi!
>> >
>> > Attached patch fixes ticket #1673.
>> > ISO13818-1 indeed specifies in §2.4.3.3 that values
>> > up to 0xF are reserved.
>> >
>> > Please comment, Carl Eugen
>>
>> >  mpegtsenc.c |    2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> > 60a99310ff7b9ef476fa1d70bb01ffcaaf550226
>> 0001-lavf-mpegtsenc-Set-min-PID-for-data-pkt-to-0x0010.patch
>> > From 06371416c00eaf73430d1bb7d841167356adbe23 Mon Sep 17 00:00:00 2001
>> > From: Sylvain Laurent <syllaur@gmail.com>
>> > Date: Sat, 24 Sep 2016 12:01:34 +0200
>> > Subject: [PATCH] lavf/mpegtsenc: Set min PID for data pkt to 0x0010.
>> >
>> > Fixes ticket #1673.
>> > ---
>> >  libavformat/mpegtsenc.c |    2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
>> > index fd849e5..c10a3bf 100644
>> > --- a/libavformat/mpegtsenc.c
>> > +++ b/libavformat/mpegtsenc.c
>> > @@ -1843,7 +1843,7 @@ static const AVOption options[] = {
>> >        { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
>> >      { "mpegts_start_pid", "Set the first pid.",
>> >        offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT,
>> > -      { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
>> > +      { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
>> >      { "mpegts_m2ts_mode", "Enable m2ts mode.",
>>
>> the previous limit was set by Zach Swena (in CC)
>> was there a reason why it was 0x20 and not 0x10 ?
>>
>> Thanks
>>
>> [...]
>>
>>
>> --
>> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> Never trust a computer, one day, it may think you are the virus. -- Compn
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>
Carl Eugen Hoyos Sept. 27, 2016, 7:15 a.m. UTC | #4
2016-09-27 5:42 GMT+02:00 Andrey Turkin <andrey.turkin@gmail.com>:
> Nevermind, I didn't though this through. Default value is high enough to
> comply with all standards.

I'll apply the patch if there are no objections.

Carl Eugen
Carl Eugen Hoyos Sept. 28, 2016, 3:37 p.m. UTC | #5
2016-09-27 9:15 GMT+02:00 Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> 2016-09-27 5:42 GMT+02:00 Andrey Turkin <andrey.turkin@gmail.com>:
>> Nevermind, I didn't though this through. Default value is high enough to
>> comply with all standards.
>
> I'll apply the patch if there are no objections.

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index fd849e5..c10a3bf 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1843,7 +1843,7 @@  static const AVOption options[] = {
       { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
     { "mpegts_start_pid", "Set the first pid.",
       offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT,
-      { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
+      { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
     { "mpegts_m2ts_mode", "Enable m2ts mode.",
       offsetof(MpegTSWrite, m2ts_mode), AV_OPT_TYPE_BOOL,
       { .i64 = -1 }, -1, 1, AV_OPT_FLAG_ENCODING_PARAM },