lavc: Document in/out AVCodecParameters ownership in AVBSFContext

Message ID 20161004154511.9164-1-vittorio.giovara@gmail.com
State Superseded
Headers show

Commit Message

Vittorio Giovara Oct. 4, 2016, 3:45 p.m.
---
 libavcodec/avcodec.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Hendrik Leppkes Oct. 4, 2016, 3:50 p.m. | #1
On Tue, Oct 4, 2016 at 5:45 PM, Vittorio Giovara
<vittorio.giovara@gmail.com> wrote:
> ---
>  libavcodec/avcodec.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 167525d..a59d7e9 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -5017,12 +5017,14 @@ typedef struct AVBSFContext {
>      void *priv_data;
>
>      /**
> -     * Parameters of the input stream. Set by the caller before av_bsf_init().
> +     * Parameters of the input stream. This field is allocated in av_bsf_init(),
> +     * Needs to be initialized by the caller before av_bsf_init().
>       */
>      AVCodecParameters *par_in;

This makes no sense to me. The caller inits it but the function then
allocates it afterwards? Wut?

>
>      /**
> -     * Parameters of the output stream. Set by the filter in av_bsf_init().
> +     * Parameters of the output stream. This field is allocated in
> +     * av_bsf_init(), it is set by the filter in av_bsf_init().
>       */
>      AVCodecParameters *par_out;
>
> --
> 2.10.0
>
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
Vittorio Giovara Oct. 4, 2016, 3:58 p.m. | #2
On Tue, Oct 4, 2016 at 11:50 AM, Hendrik Leppkes <h.leppkes@gmail.com> wrote:
> On Tue, Oct 4, 2016 at 5:45 PM, Vittorio Giovara
> <vittorio.giovara@gmail.com> wrote:
>> ---
>>  libavcodec/avcodec.h | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 167525d..a59d7e9 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -5017,12 +5017,14 @@ typedef struct AVBSFContext {
>>      void *priv_data;
>>
>>      /**
>> -     * Parameters of the input stream. Set by the caller before av_bsf_init().
>> +     * Parameters of the input stream. This field is allocated in av_bsf_init(),
>> +     * Needs to be initialized by the caller before av_bsf_init().
>>       */
>>      AVCodecParameters *par_in;
>
> This makes no sense to me. The caller inits it but the function then
> allocates it afterwards? Wut?

ops, typo, let me resend

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 167525d..a59d7e9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -5017,12 +5017,14 @@  typedef struct AVBSFContext {
     void *priv_data;
 
     /**
-     * Parameters of the input stream. Set by the caller before av_bsf_init().
+     * Parameters of the input stream. This field is allocated in av_bsf_init(),
+     * Needs to be initialized by the caller before av_bsf_init().
      */
     AVCodecParameters *par_in;
 
     /**
-     * Parameters of the output stream. Set by the filter in av_bsf_init().
+     * Parameters of the output stream. This field is allocated in
+     * av_bsf_init(), it is set by the filter in av_bsf_init().
      */
     AVCodecParameters *par_out;