diff mbox series

[FFmpeg-devel,1/6] avformat/utils: do not overwrite already existing program with defaults in av_new_program

Message ID 20201228224929.21299-1-cus@passwd.hu
State Accepted
Commit 9298e8eb61f6c796aaf7c6e14e59f345318d2753
Headers show
Series [FFmpeg-devel,1/6] avformat/utils: do not overwrite already existing program with defaults in av_new_program
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Marton Balint Dec. 28, 2020, 10:49 p.m. UTC
av_new_program returns the existing program if that already exists, in that
case it makes no sense to overwrite existing attributes.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/utils.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Marton Balint Jan. 3, 2021, 9:12 p.m. UTC | #1
On Mon, 28 Dec 2020, Marton Balint wrote:

> av_new_program returns the existing program if that already exists, in that
> case it makes no sense to overwrite existing attributes.
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavformat/utils.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 1a87d9422a..270ed8d4f2 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -4568,14 +4568,12 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
>         dynarray_add(&ac->programs, &ac->nb_programs, program);
>         program->discard = AVDISCARD_NONE;
>         program->pmt_version = -1;
> +        program->id = id;
> +        program->pts_wrap_reference = AV_NOPTS_VALUE;
> +        program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
> +        program->start_time =
> +        program->end_time   = AV_NOPTS_VALUE;
>     }
> -    program->id = id;
> -    program->pts_wrap_reference = AV_NOPTS_VALUE;
> -    program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
> -
> -    program->start_time =
> -    program->end_time   = AV_NOPTS_VALUE;
> -
>     return program;
> }

Ping for the series, will apply soon.

Thanks,
Marton
Marton Balint Jan. 9, 2021, 11:26 p.m. UTC | #2
On Sun, 3 Jan 2021, Marton Balint wrote:

>
>
> On Mon, 28 Dec 2020, Marton Balint wrote:
>
>> av_new_program returns the existing program if that already exists, in that
>> case it makes no sense to overwrite existing attributes.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>> libavformat/utils.c | 12 +++++-------
>> 1 file changed, 5 insertions(+), 7 deletions(-)
>>
>> diff --git a/libavformat/utils.c b/libavformat/utils.c
>> index 1a87d9422a..270ed8d4f2 100644
>> --- a/libavformat/utils.c
>> +++ b/libavformat/utils.c
>> @@ -4568,14 +4568,12 @@ AVProgram *av_new_program(AVFormatContext *ac, int 
> id)
>>         dynarray_add(&ac->programs, &ac->nb_programs, program);
>>         program->discard = AVDISCARD_NONE;
>>         program->pmt_version = -1;
>> +        program->id = id;
>> +        program->pts_wrap_reference = AV_NOPTS_VALUE;
>> +        program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
>> +        program->start_time =
>> +        program->end_time   = AV_NOPTS_VALUE;
>>     }
>> -    program->id = id;
>> -    program->pts_wrap_reference = AV_NOPTS_VALUE;
>> -    program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
>> -
>> -    program->start_time =
>> -    program->end_time   = AV_NOPTS_VALUE;
>> -
>>     return program;
>> }
>
> Ping for the series, will apply soon.

Applied.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1a87d9422a..270ed8d4f2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4568,14 +4568,12 @@  AVProgram *av_new_program(AVFormatContext *ac, int id)
         dynarray_add(&ac->programs, &ac->nb_programs, program);
         program->discard = AVDISCARD_NONE;
         program->pmt_version = -1;
+        program->id = id;
+        program->pts_wrap_reference = AV_NOPTS_VALUE;
+        program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
+        program->start_time =
+        program->end_time   = AV_NOPTS_VALUE;
     }
-    program->id = id;
-    program->pts_wrap_reference = AV_NOPTS_VALUE;
-    program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
-
-    program->start_time =
-    program->end_time   = AV_NOPTS_VALUE;
-
     return program;
 }