diff mbox series

[FFmpeg-devel] libavformat/mpegts.c: ignore a section with next flag

Message ID 20220403102316.189763-1-aimingoff@pc.nifty.jp
State Accepted
Commit ad063e6e10e19b0e1d3d59825179870bcdd9685e
Headers show
Series [FFmpeg-devel] libavformat/mpegts.c: ignore a section with next flag | expand

Checks

Context Check Description
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

TADANO Tokumei April 3, 2022, 10:23 a.m. UTC
'current_next_indicator' of 0 (next) on each section header indicates
the service information is for immediate future one.
ffmpeg doesn't need to parse it but current (1) one.

ref: section 5.1.1 of DVB BlueBook A038 (EN 300 468)

Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
---
 libavformat/mpegts.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

TADANO Tokumei April 7, 2022, 9:26 a.m. UTC | #1
will apply

On 2022/04/03 19:23, TADANO Tokumei wrote:
> 'current_next_indicator' of 0 (next) on each section header indicates
> the service information is for immediate future one.
> ffmpeg doesn't need to parse it but current (1) one.
> 
> ref: section 5.1.1 of DVB BlueBook A038 (EN 300 468)
> 
> Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
> ---
>   libavformat/mpegts.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index ecffb01562..49f7735123 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -645,6 +645,7 @@ typedef struct SectionHeader {
>       uint8_t tid;
>       uint16_t id;
>       uint8_t version;
> +    uint8_t current_next;
>       uint8_t sec_num;
>       uint8_t last_sec_num;
>   } SectionHeader;
> @@ -773,6 +774,7 @@ static int parse_section_header(SectionHeader *h,
>       if (val < 0)
>           return val;
>       h->version = (val >> 1) & 0x1f;
> +    h->current_next = val & 0x01;
>       val = get8(pp, p_end);
>       if (val < 0)
>           return val;
> @@ -2332,6 +2334,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>           return;
>       if (h->tid != PMT_TID)
>           return;
> +    if (!h->current_next)
> +        return;
>       if (skip_identical(h, tssf))
>           return;
>   
> @@ -2541,6 +2545,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>           return;
>       if (h->tid != PAT_TID)
>           return;
> +    if (!h->current_next)
> +        return;
>       if (ts->skip_changes)
>           return;
>   
> @@ -2679,6 +2685,8 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>           return;
>       if (h->tid != SDT_TID)
>           return;
> +    if (!h->current_next)
> +        return;
>       if (ts->skip_changes)
>           return;
>       if (skip_identical(h, tssf))
TADANO Tokumei April 8, 2022, 9:43 a.m. UTC | #2
sorry, I don't have permission to push the commits.
I've misunderstood the Developer Document.

On 2022/04/07 18:26, TADANO Tokumei wrote:
> will apply
> 
> On 2022/04/03 19:23, TADANO Tokumei wrote:
>> 'current_next_indicator' of 0 (next) on each section header indicates
>> the service information is for immediate future one.
>> ffmpeg doesn't need to parse it but current (1) one.
>>
>> ref: section 5.1.1 of DVB BlueBook A038 (EN 300 468)
>>
>> Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
>> ---
>>   libavformat/mpegts.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
>> index ecffb01562..49f7735123 100644
>> --- a/libavformat/mpegts.c
>> +++ b/libavformat/mpegts.c
>> @@ -645,6 +645,7 @@ typedef struct SectionHeader {
>>       uint8_t tid;
>>       uint16_t id;
>>       uint8_t version;
>> +    uint8_t current_next;
>>       uint8_t sec_num;
>>       uint8_t last_sec_num;
>>   } SectionHeader;
>> @@ -773,6 +774,7 @@ static int parse_section_header(SectionHeader *h,
>>       if (val < 0)
>>           return val;
>>       h->version = (val >> 1) & 0x1f;
>> +    h->current_next = val & 0x01;
>>       val = get8(pp, p_end);
>>       if (val < 0)
>>           return val;
>> @@ -2332,6 +2334,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>>           return;
>>       if (h->tid != PMT_TID)
>>           return;
>> +    if (!h->current_next)
>> +        return;
>>       if (skip_identical(h, tssf))
>>           return;
>> @@ -2541,6 +2545,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>>           return;
>>       if (h->tid != PAT_TID)
>>           return;
>> +    if (!h->current_next)
>> +        return;
>>       if (ts->skip_changes)
>>           return;
>> @@ -2679,6 +2685,8 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>>           return;
>>       if (h->tid != SDT_TID)
>>           return;
>> +    if (!h->current_next)
>> +        return;
>>       if (ts->skip_changes)
>>           return;
>>       if (skip_identical(h, tssf))
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint April 9, 2022, 6:29 p.m. UTC | #3
On Sun, 3 Apr 2022, TADANO Tokumei wrote:

> 'current_next_indicator' of 0 (next) on each section header indicates
> the service information is for immediate future one.
> ffmpeg doesn't need to parse it but current (1) one.
>
> ref: section 5.1.1 of DVB BlueBook A038 (EN 300 468)

Thanks, applied.

Regards,
Marton

>
> Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
> ---
> libavformat/mpegts.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index ecffb01562..49f7735123 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -645,6 +645,7 @@ typedef struct SectionHeader {
>     uint8_t tid;
>     uint16_t id;
>     uint8_t version;
> +    uint8_t current_next;
>     uint8_t sec_num;
>     uint8_t last_sec_num;
> } SectionHeader;
> @@ -773,6 +774,7 @@ static int parse_section_header(SectionHeader *h,
>     if (val < 0)
>         return val;
>     h->version = (val >> 1) & 0x1f;
> +    h->current_next = val & 0x01;
>     val = get8(pp, p_end);
>     if (val < 0)
>         return val;
> @@ -2332,6 +2334,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>         return;
>     if (h->tid != PMT_TID)
>         return;
> +    if (!h->current_next)
> +        return;
>     if (skip_identical(h, tssf))
>         return;
>
> @@ -2541,6 +2545,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>         return;
>     if (h->tid != PAT_TID)
>         return;
> +    if (!h->current_next)
> +        return;
>     if (ts->skip_changes)
>         return;
>
> @@ -2679,6 +2685,8 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
>         return;
>     if (h->tid != SDT_TID)
>         return;
> +    if (!h->current_next)
> +        return;
>     if (ts->skip_changes)
>         return;
>     if (skip_identical(h, tssf))
> -- 
> 2.30.2
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index ecffb01562..49f7735123 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -645,6 +645,7 @@  typedef struct SectionHeader {
     uint8_t tid;
     uint16_t id;
     uint8_t version;
+    uint8_t current_next;
     uint8_t sec_num;
     uint8_t last_sec_num;
 } SectionHeader;
@@ -773,6 +774,7 @@  static int parse_section_header(SectionHeader *h,
     if (val < 0)
         return val;
     h->version = (val >> 1) & 0x1f;
+    h->current_next = val & 0x01;
     val = get8(pp, p_end);
     if (val < 0)
         return val;
@@ -2332,6 +2334,8 @@  static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         return;
     if (h->tid != PMT_TID)
         return;
+    if (!h->current_next)
+        return;
     if (skip_identical(h, tssf))
         return;
 
@@ -2541,6 +2545,8 @@  static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         return;
     if (h->tid != PAT_TID)
         return;
+    if (!h->current_next)
+        return;
     if (ts->skip_changes)
         return;
 
@@ -2679,6 +2685,8 @@  static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         return;
     if (h->tid != SDT_TID)
         return;
+    if (!h->current_next)
+        return;
     if (ts->skip_changes)
         return;
     if (skip_identical(h, tssf))