[vlc-devel] [PATCH 1/3] mpeg_audio: mark output blocks as keyframes

Steve Lhomme robux4 at gmail.com
Tue Aug 9 08:21:36 CEST 2016


On Mon, Aug 8, 2016 at 7:36 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> Audio, as keyframes?
> Is that really correct?

The libavformat muxer expects the caller to tell if frames are
keyframes or not. And in Matroska if frames are not marked as
keyframes you're not supposed to use them for seeking. That's a
problem for audio-only files we create.
We could either decide that all audio (and subtitles) block that are
sent to libavformat are keyframes or we could rely on each codec. I'm
not aware of any audio or subtitle codec that uses non keyframes but I
might be wrong.

Also I don't know if this has implications inside VLC when audio
frames are not marked as keyframes. When coming from libavcodec they
are marked as keyframes.

> On 08 Aug, Steve Lhomme wrote :
>> ---
>>  modules/codec/mpeg_audio.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/modules/codec/mpeg_audio.c b/modules/codec/mpeg_audio.c
>> index 9cb4f4f..50c73ea 100644
>> --- a/modules/codec/mpeg_audio.c
>> +++ b/modules/codec/mpeg_audio.c
>> @@ -465,6 +465,8 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
>>                  //p_dec->b_error = true;
>>                  return NULL;
>>              }
>> +            if (p_out_buffer)
>> +                p_out_buffer->i_flags |= BLOCK_FLAG_TYPE_I;
>>
>>              /* Free bitrate only */
>>              if( p_sys->i_bit_rate == 0 )
>> --
>> 2.8.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> With my kindest regards,
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> 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