[FFmpeg-devel] [PATCH 3/3] Add assert that the avcodec lock isheld when initializing static VLC tables.

Don Moir donmoir at comcast.net
Mon Dec 3 00:55:30 CET 2012


----- Original Message ----- 
From: "Nicolas George" <nicolas.george at normalesup.org>
To: "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org>
Sent: Sunday, December 02, 2012 5:40 PM
Subject: Re: [FFmpeg-devel] [PATCH 3/3] Add assert that the avcodec lock isheld when initializing static VLC tables.


Le duodi 12 frimaire, an CCXXI, Don Moir a écrit :
> Looks to me there are hundreds of places av_assert0 is called and
> not just a few and av_assert0 calls abort.

> Where are your bug reports?

Assuming everyone is idiot is not very constructive.

Do I need a bug report for this ?

I am not saying you might not have good reason for calling abort and no I have not received an abort except in a very unusual case. 
But in that case I had no idea why or where it was called from and my testapp did not trap it. The higher lever app does catch it 
but it doesnt tell us very much. We basically know it died somewhere in ffmpeg.

>  the thing is I would like
> to have an easy indication where and why it failed.

> Do you know what an assert is? If there was a way of knowing why it failed,
> it would be a condition, not an assert.

I am wondering if you do. The code gives a condition that triggered av_assert0 call and better it gives the file and line number 
where the assert was called.

av_assert0 calls av_log with the file and line number information. The problem with that is av_log is sometimes cluttered with 
hundreds and thousands of messages which are mostly useless outside of debugging and I turn this off rather than wasting time with 
BS. You pretty much never know where it came from and when you are running several videos in different threads at a time its a mixed 
bag.

Would be good if rather than calling av_log in av_assert0 , the condition, file, and line number was passed back to the app via some 
other funtion rather than av_log which is not burdoned by crap. This would also give a better oportunity for the app to log its own 
info with something meaningful and maybe get the problem fixed.



More information about the ffmpeg-devel mailing list