[FFmpeg-devel] [PATCH] tty: return av_get_packet() error codes instead of converting them to EIO
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Sep 4 07:25:15 CEST 2012
On 4 Sep 2012, at 01:44, Peter Ross <pross at xvid.org> wrote:
> ---
> Updated.
>
> libavformat/tty.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/tty.c b/libavformat/tty.c
> index a71c6b1..39380e2 100644
> --- a/libavformat/tty.c
> +++ b/libavformat/tty.c
> @@ -135,8 +135,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
> }
>
> pkt->size = av_get_packet(avctx->pb, pkt, n);
> - if (pkt->size <= 0)
> - return AVERROR(EIO);
> + if (pkt->size < 0)
> + return pkt->size;
Is that change in behaviour (0 sized packets no longer considered an error) intended/correct?
Particularly since I guess that case can happen both due to n being 0 or due the the file being cut at exactly the start of a packet.
(not that it is likely to matter much in practice, but making code less correct to save a single ?: seems like a bad trade-off to me).
More information about the ffmpeg-devel
mailing list