[libav-devel] [PATCH] dcadec: add some logging before returning on error.

Luca Barbato lu_zero at gentoo.org
Fri Nov 29 15:56:53 CET 2013


On 29/11/13 14:54, Anton Khirnov wrote:
> 
> On Fri, 29 Nov 2013 14:30:14 +0100, Luca Barbato <lu_zero at gentoo.org> wrote:
>> On 29/11/13 13:47, Tim Walker wrote:
>>> Based on a patch by Michael Niedermayer.
>>> ---
>>>  libavcodec/dcadec.c | 22 +++++++++++++++++-----
>>>  1 file changed, 17 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
>>> index 50cbf2d..8b50698 100644
>>> --- a/libavcodec/dcadec.c
>>> +++ b/libavcodec/dcadec.c
>>> @@ -1301,8 +1301,10 @@ static int dca_subframe_footer(DCAContext *s, int base_channel)
>>>  
>>>              aux_data_end = 8 * aux_data_count + get_bits_count(&s->gb);
>>>  
>>> -            if (get_bits_long(&s->gb, 32) != 0x9A1105A0) // nSYNCAUX
>>> +            if (get_bits_long(&s->gb, 32) != 0x9A1105A0) { // nSYNCAUX
>>> +                av_log(s->avctx,AV_LOG_ERROR, "nSYNCAUX mismatch\n");
>>
>> Either be informative (and print the mismatching value) or do not print
>> anything.
> 
> I disagree with this.
> The main point of the error message is not to educate the users, but to tell the
> developers where exactly does the error originate. So it's acceptable if the
> message is not very comprehensible, as long as it is unique.
> 

As developer I'd rather have the value instead of get deep down in gdb
to extract it.

In the other news I'm pondering of adding some code to av_log so that in
debug mode breaks by default in gdb.

lu


More information about the libav-devel mailing list