[vlc-devel] [PATCH 1/9] core: force the output to b_packetized when a packetizer is opened successfully

Steve Lhomme robux4 at gmail.com
Thu Jul 13 08:02:51 CEST 2017


On Wed, Jul 12, 2017 at 5:26 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> On mercredi 12 juillet 2017 16:54:04 EEST Steve Lhomme wrote:
>> ---
>>  src/input/decoder.c | 7 +++++--
>>  src/input/demux.c   | 2 ++
>>  2 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/input/decoder.c b/src/input/decoder.c
>> index b292658b38..5a976bf111 100644
>> --- a/src/input/decoder.c
>> +++ b/src/input/decoder.c
>> @@ -187,8 +187,9 @@ static int LoadDecoder( decoder_t *p_dec, bool
>> b_packetizer, es_format_Clean( &p_dec->fmt_in );
>>          return -1;
>>      }
>> -    else
>> -        return 0;
>> +    if (b_packetizer)
>> +        p_dec->fmt_out.b_packetized = true;
>> +    return 0;
>>  }
>>
>>  /**
>> @@ -1916,6 +1917,8 @@ static decoder_t *decoder_New( vlc_object_t *p_parent,
>> input_thread_t *p_input, return NULL;
>>      }
>>
>> +    if ( p_sout != NULL )
>> +        p_dec->fmt_out.b_packetized = true;
>>      p_dec->p_owner->p_clock = p_clock;
>>      assert( p_dec->fmt_out.i_cat != UNKNOWN_ES );
>>
>> diff --git a/src/input/demux.c b/src/input/demux.c
>> index 109a386775..f1c6657799 100644
>> --- a/src/input/demux.c
>> +++ b/src/input/demux.c
>> @@ -530,6 +530,8 @@ decoder_t *demux_PacketizerNew( demux_t *p_demux,
>> es_format_t *p_fmt, const char return NULL;
>>      }
>>
>> +    p_packetizer->fmt_out.b_packetized = true;
>> +
>>      return p_packetizer;
>>  }
>
> Modifying the output format after the module is loaded violates the memory
> model (if the plugin is threaded or asynchronous). I don't know if we care for

This is all done after the packetizer is created and before it's
returned (because it was created successfully) to the code for use. So
the fact it might be threaded or asynchronous is irrelevant. It's not
used yet.

We could set this flag once and for all before the creation. After all
if a packetizer doesn't have a packetized output then it's not a
packetizer.

> packetizers, but that seems like a bad idea/practice.
>
> --
> Rémi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list