[FFmpeg-trac] #4874(avcodec:new): AAC decoder frame->nb_samples & frame->channels is wrong at get_buffer2

FFmpeg trac at avcodec.org
Wed Sep 23 10:57:40 CEST 2015


#4874: AAC decoder frame->nb_samples & frame->channels is wrong at get_buffer2
-------------------------------------+-----------------------------------
             Reporter:  zylthinking  |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avcodec
              Version:  git-master   |               Resolution:
             Keywords:  aac          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-----------------------------------

Comment (by gjdfgh):

 Note that get_buffer2 doesn't really have to allocate an AVFrame as it's
 output later. It's basically just memory allocation. A decoder can change
 an AVFrame as it likes after allocation, and for example reduce the sample
 count.

 For example, I see this code in aacdec_template.c:

 {{{
     ac->frame->nb_samples = 2048;
     if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
         return ret;
 }}}

 and later:

 {{{
     ac->frame->nb_samples = samples;
     ac->frame->sample_rate = avctx->sample_rate;
 }}}

 So it's completely expected that the returned frame can be slightly
 different.

 I don't know about this channel count business though.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4874#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list