[FFmpeg-devel] ffplay and the return values
nicolas.george at normalesup.org
Tue Apr 10 15:51:28 CEST 2012
Le duodi 22 germinal, an CCXX, Stefano Sabatini a écrit :
> On the other hand I'm not too confortable with the idea of adopting
> *application level* error codes and add more complexity/maintainance
> overhead, and I don't think the user needs *that* level of control on
> the exit reason.
I agree. Furthermore, the universal convention is that 0 means success,
other means failure, and an user-requested exit is not a failure.
> An alternative implementation may simply expose the AVERROR* code to
> an environment variable (FFPLAY_ERROR, FFPLAY_ERROR_REASON) - or a
> possibly a more robust system (writing to a .pid file?) in case more
> instances are run at the same time.
> Would be that enough for your use case? The application may set
> $FFPLAY_ERROR to AVERROR_EXIT in case of user-requested early exit
> (see libavutil/error.h).
I am not sure what you mean exactly, but I suppose you remember that
environment variables can not be altered upwards in the process ancestry: an
application can transmit information to its subprocesses by environment
variables, but the subprocesses can not return information that way.
The simplest way is obviously to write something to the standard output.
ffplay already writes its progress there: maybe it is enough to check if the
video was read entirely.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel