Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-30 Thread Michael Niedermayer
On Mon, Mar 30, 2015 at 10:24:06PM +0530, Himangi Saraogi wrote: > --- > libavcodec/tiffenc.c | 13 - > 1 file changed, 8 insertions(+), 5 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but

[FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-30 Thread Himangi Saraogi
--- libavcodec/tiffenc.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 44cd956..2cdac0b 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -164,7 +164,8 @@ static int add_entry1(TiffEncoderContext *s

Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-30 Thread Himangi Saraogi
On 30 March 2015 at 22:00, Carl Eugen Hoyos wrote: > Himangi Saraogi gmail.com> writes: > > > case TIFF_LZW: > > return ff_lzw_encode(s->lzws, src, n); > > default: > > -return -1; > > +return AVERROR(EINVAL); > > Please print a message in this case or > explai

Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-30 Thread Carl Eugen Hoyos
Himangi Saraogi gmail.com> writes: > case TIFF_LZW: > return ff_lzw_encode(s->lzws, src, n); > default: > -return -1; > +return AVERROR(EINVAL); Please print a message in this case or explain why this is not a good idea. (And please don't make me write this a

[FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-30 Thread Himangi Saraogi
--- libavcodec/tiffenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 44cd956..7a872a2 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -164,7 +164,8 @@ static int add_entry1(TiffEncoderContext *s,

Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-29 Thread Carl Eugen Hoyos
James Almer gmail.com> writes: > > case TIFF_LZW: > > return ff_lzw_encode(s->lzws, src, n); > > default: > > -return -1; > > +return AVERROR_BUG; > > AVERROR(EINVAL) here. > > If i do "ffmpeg -i INPUT -compression_algo 2 OUTPUT.tiff" > I'm not triggering a b

Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-28 Thread James Almer
On 29/03/15 1:18 AM, Himangi Saraogi wrote: > --- > libavcodec/tiffenc.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c > index 44cd956..a94b700 100644 > --- a/libavcodec/tiffenc.c > +++ b/libavcodec/tiffenc.c > @@

[FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-28 Thread Himangi Saraogi
--- libavcodec/tiffenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 44cd956..a94b700 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -164,7 +164,8 @@ static int add_entry1(TiffEncoderContext *s,

Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-28 Thread Nicolas George
L'octidi 8 germinal, an CCXXIII, Carl Eugen Hoyos a écrit : > -1 seems more correct to me. -1 is never correct. On Linux (and apparently BSD too), -1 is AVERROR(EPERM), definitely not what you want. One libav guy suggested AVERROR_UNKNOWN; in FFmpeg we have AVERROR_EXTERNAL "Generic error in an e

Re: [FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-28 Thread Carl Eugen Hoyos
Himangi Saraogi gmail.com> writes: > if (compress(dst, &zlen, src, n) != Z_OK) { > av_log(s->avctx, AV_LOG_ERROR, "Compressing failed\n"); > -return -1; > +return AVERROR_INVALIDDATA; -1 seems more correct to me. > case TIFF_LZW: > ret

[FFmpeg-devel] [PATCH] tiff: Return more meaningful error codes

2015-03-28 Thread Himangi Saraogi
--- libavcodec/tiffenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 44cd956..fc9b78e 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -164,7 +164,8 @@ static int add_entry1(TiffEncoderContext *s,