diff mbox series

[FFmpeg-devel,v3,3/5] avformat/hls: relay programs to child muxers

Message ID 20230217170249.8148-3-ffmpeg@gyani.pro
State New
Headers show
Series [FFmpeg-devel,v3,1/5] avformat: add av_program_add_stream_index2() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Gyan Doshi Feb. 17, 2023, 5:02 p.m. UTC
---
 libavformat/hlsenc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Marton Balint Feb. 17, 2023, 10:01 p.m. UTC | #1
On Fri, 17 Feb 2023, Gyan Doshi wrote:

> ---
> libavformat/hlsenc.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index e1f96feda3..cf2b36da01 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -911,6 +911,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
>         st->id = vs->streams[i]->id;
>     }
>
> +    for (i = 0; i < s->nb_programs; i++) {
> +        ret = av_program_copy(oc, (const AVFormatContext *)s, s->programs[i]->id, 0);
> +        if (ret < 0) {
> +            av_log(s, AV_LOG_WARNING, "unable to transfer program %d to child muxer\n", s->programs[i]->id);

Aren't these errors supposed to be propagated back as hard failures, 
instead of simply ignoring them? The next 2 patches also has this problem.

Thanks,
Marton
Gyan Doshi Feb. 18, 2023, 4:51 a.m. UTC | #2
On 2023-02-18 03:31 am, Marton Balint wrote:
>
>
> On Fri, 17 Feb 2023, Gyan Doshi wrote:
>
>> ---
>> libavformat/hlsenc.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>> index e1f96feda3..cf2b36da01 100644
>> --- a/libavformat/hlsenc.c
>> +++ b/libavformat/hlsenc.c
>> @@ -911,6 +911,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
>>         st->id = vs->streams[i]->id;
>>     }
>>
>> +    for (i = 0; i < s->nb_programs; i++) {
>> +        ret = av_program_copy(oc, (const AVFormatContext *)s, 
>> s->programs[i]->id, 0);
>> +        if (ret < 0) {
>> +            av_log(s, AV_LOG_WARNING, "unable to transfer program %d 
>> to child muxer\n", s->programs[i]->id);
>
> Aren't these errors supposed to be propagated back as hard failures, 
> instead of simply ignoring them? The next 2 patches also has this 
> problem.


Updated in v4.

Regards,
Gyan
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index e1f96feda3..cf2b36da01 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -911,6 +911,14 @@  FF_ENABLE_DEPRECATION_WARNINGS
         st->id = vs->streams[i]->id;
     }
 
+    for (i = 0; i < s->nb_programs; i++) {
+        ret = av_program_copy(oc, (const AVFormatContext *)s, s->programs[i]->id, 0);
+        if (ret < 0) {
+            av_log(s, AV_LOG_WARNING, "unable to transfer program %d to child muxer\n", s->programs[i]->id);
+            break;
+        }
+    }
+
     vs->start_pos = 0;
     vs->new_start = 1;