diff mbox series

[FFmpeg-devel] avformat/hlsenc: allow a custom SDT and PAT period

Message ID 20200204213923.21382-1-cus@passwd.hu
State Accepted
Headers show
Series [FFmpeg-devel] avformat/hlsenc: allow a custom SDT and PAT period
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Marton Balint Feb. 4, 2020, 9:39 p.m. UTC
The default is not to write SDT and PAT periodically, only in the beginning of
every segment. After this patch the user might override this if needed.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/hlsenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Steven Liu Feb. 4, 2020, 11:45 p.m. UTC | #1
Marton Balint <cus@passwd.hu> 于 2020年2月5日周三 上午5:39写道:

> The default is not to write SDT and PAT periodically, only in the
> beginning of
> every segment. After this patch the user might override this if needed.
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/hlsenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 87b861d437..f6dd894343 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -861,8 +861,8 @@ static int hls_mux_init(AVFormatContext *s,
> VariantStream *vs)
>          /* We only require one PAT/PMT per segment. */
>          char period[21];
>          snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
> -        av_dict_set(&options, "sdt_period", period, 0);
> -        av_dict_set(&options, "pat_period", period, 0);
> +        av_dict_set(&options, "sdt_period", period,
> AV_DICT_DONT_OVERWRITE);
> +        av_dict_set(&options, "pat_period", period,
> AV_DICT_DONT_OVERWRITE);
>      }
>      ret = avformat_init_output(oc, &options);
>      remaining_options = av_dict_count(options);
> --
> 2.16.4
>
> LGTM
>
> _______________________________________________
> 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 Feb. 5, 2020, 8:36 p.m. UTC | #2
On Wed, 5 Feb 2020, Steven Liu wrote:

> Marton Balint <cus@passwd.hu> 于 2020年2月5日周三 上午5:39写道:
>
>> The default is not to write SDT and PAT periodically, only in the
>> beginning of
>> every segment. After this patch the user might override this if needed.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/hlsenc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>> index 87b861d437..f6dd894343 100644
>> --- a/libavformat/hlsenc.c
>> +++ b/libavformat/hlsenc.c
>> @@ -861,8 +861,8 @@ static int hls_mux_init(AVFormatContext *s,
>> VariantStream *vs)
>>          /* We only require one PAT/PMT per segment. */
>>          char period[21];
>>          snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
>> -        av_dict_set(&options, "sdt_period", period, 0);
>> -        av_dict_set(&options, "pat_period", period, 0);
>> +        av_dict_set(&options, "sdt_period", period,
>> AV_DICT_DONT_OVERWRITE);
>> +        av_dict_set(&options, "pat_period", period,
>> AV_DICT_DONT_OVERWRITE);
>>      }
>>      ret = avformat_init_output(oc, &options);
>>      remaining_options = av_dict_count(options);
>> --
>> 2.16.4
>>
>> LGTM

Thanks, applied.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 87b861d437..f6dd894343 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -861,8 +861,8 @@  static int hls_mux_init(AVFormatContext *s, VariantStream *vs)
         /* We only require one PAT/PMT per segment. */
         char period[21];
         snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
-        av_dict_set(&options, "sdt_period", period, 0);
-        av_dict_set(&options, "pat_period", period, 0);
+        av_dict_set(&options, "sdt_period", period, AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&options, "pat_period", period, AV_DICT_DONT_OVERWRITE);
     }
     ret = avformat_init_output(oc, &options);
     remaining_options = av_dict_count(options);