[vlc-devel] [vlc-commits] avcodec: audio. use send_packet/receive_frame in decoding
Rémi Denis-Courmont
remi at remlab.net
Wed Sep 7 12:24:21 CEST 2016
Le mercredi 7 septembre 2016, 11:16:44 Ilkka Ollakka a écrit :
> vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Sep 4
> 11:30:39 2016 +0300| [d150b4bce968ffb97f387d4634b1d1d579259447] |
> committer: Ilkka Ollakka
>
> avcodec: audio. use send_packet/receive_frame in decoding
This breaks AAC playback for me, also causes busy loop at end of stream.
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d150b4bce968ffb97f3
> > 87d4634b1d1d579259447
> ---
>
> modules/codec/avcodec/audio.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
> index 159dbf1..05d22cf 100644
> --- a/modules/codec/avcodec/audio.c
> +++ b/modules/codec/avcodec/audio.c
> @@ -323,7 +323,15 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t
> **pp_block ) pkt.data = p_block->p_buffer;
> pkt.size = p_block->i_buffer;
>
> - int used = avcodec_decode_audio4( ctx, frame, &got_frame, &pkt );
> + int used = avcodec_send_packet( ctx, &pkt );
> + if( used < 0 )
> + {
> + msg_Warn( p_dec, "cannot decode one frame (%zu bytes)",
> + p_block->i_buffer );
> + goto end;
> + }
> + used = avcodec_receive_frame( ctx, frame );
> + got_frame = used == 0;
> if( used < 0 )
> {
> msg_Warn( p_dec, "cannot decode one frame (%zu bytes)",
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list