[FFmpeg-devel] [libav-devel] [PATCH 2/2] wmalosslessdec: reset frame->nb_samples on packet loss

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Jul 7 22:23:11 CEST 2015


On 06.07.2015 10:43, Luca Barbato wrote:
> On 05/07/15 20:42, Andreas Cadhalpun wrote:
>> Like that:
>>         if (s->packet_loss) {
>>             /* Reset number of saved bits so that the decoder does not start
>>              * to decode incomplete frames in the s->len_prefix == 0 case. */
>>             s->num_saved_bits = 0;
>>             s->packet_loss    = 0;
>>             init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
>>         }
> 
> So there is a combination that would not return invaliddata and yet
> return an invalid frame?

Exactly that is the problem. In particular:
    *got_frame_ptr   = s->frame->nb_samples > 0;

So got_frame_ptr gets set, even though no frame data is present.

Best regards,
Andreas


More information about the ffmpeg-devel mailing list