[FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg: exit application when decoding returns AVERROR_EXIT

Soft Works softworkz at hotmail.com
Tue Oct 26 06:33:58 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> James Almer
> Sent: Monday, October 25, 2021 5:33 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg: exit
> application when decoding returns AVERROR_EXIT
> 
> On 10/20/2021 12:00 PM, Soft Works wrote:
> >
> >
> >> -----Original Message-----
> >> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> >> Nicolas George
> >> Sent: Wednesday, October 20, 2021 4:57 PM
> >> To: FFmpeg development discussions and patches <ffmpeg-
> >> devel at ffmpeg.org>
> >> Subject: Re: [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg: exit
> >> application when decoding returns AVERROR_EXIT
> >>
> >> Soft Works (12021-10-18):
> >>> Introduce a way for decoders to request application exit via
> error
> >> return
> >>>
> >>> Signed-off-by: softworkz <softworkz at hotmail.com>
> >>> ---
> >>>   fftools/ffmpeg.c | 2 +-
> >>>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> >>> index 9d4f9d7a2b..dbbe670a0a 100644
> >>> --- a/fftools/ffmpeg.c
> >>> +++ b/fftools/ffmpeg.c
> >>> @@ -2727,7 +2727,7 @@ static int process_input_packet(InputStream
> >> *ist, const AVPacket *pkt, int no_eo
> >>>                   av_log(NULL, AV_LOG_FATAL, "Error while
> processing
> >> the decoded "
> >>>                          "data for stream #%d:%d\n", ist-
> >>> file_index, ist->st->index);
> >>>               }
> >>> -            if (!decode_failed || exit_on_error)
> >>> +            if (!decode_failed || exit_on_error || ret ==
> >> AVERROR_EXIT)
> >>>                   exit_program(1);
> >>>               break;
> >>>           }
> >>
> >> On top of everything else that has been said about it, this is not
> >> the
> >> semantic of AVERROR_EXIT, which is meant for communication within
> a
> >> library.
> >
> > Sure. What would be a better way?
> 
> What is this scenario that makes cuviddec always return this
> CUDA_ERROR_UNKNOWN error when calling cuvidParseVideoData()? Why did
> it
> not happen during init()? If there's a problem with the underlying
> hardware, I'd expect the process to not even be able to reach the
> point
> where you pass packets to it.

My approach so far was on a more general side: I've seen that this
can happen => find a way to prevent this from happening, no matter
what input file has caused this and no matter whether that file is
valid or not.

But if you would like to reproduce the issue, I could get the file from
the user who encountered this. I can also provide the 10 GB log (80MB
compressed)

Do you want those files?

Thanks for replying,
softworkz



More information about the ffmpeg-devel mailing list