On 06/09/2011 01:26 PM, Anton Khirnov wrote:

> 
> On Thu, 09 Jun 2011 09:51:24 -0400, Justin Ruggles <[email protected]> 
> wrote:
>> On 06/09/2011 06:27 AM, Anton Khirnov wrote:
>>
>>> Add support for demuxer private options.
>>
>>> +int avformat_open_input(AVFormatContext **ps, const char *filename, 
>>> AVDictionary **options)
>>> +{
>>> +    AVFormatContext *s = *ps;
>> [...]
>>> +fail:
>>> +    av_dict_free(&tmp);
>>> +    if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
>>> +        avio_close(s->pb);
>>> +    avformat_free_context(s);
>>> +    *ps = NULL;
>>
>>
>> Do we really want to free and zero a user-supplied AVFormatContext on
>> failure?  If so, we should probably say so in the documentation.  If not
>> we need to check whether or not the user supplied a pre-allocated context.
>>
> 
> Is there a reason not to free it? The caller is unlikely to need it.


Not particularly, except that the user might not expect that behavior.
It should at least be documented that a user-allocated context will be
free'd on failure.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to