[FFmpeg-devel] [PATCH 7/9] avformat/wavdec: Fix s337m last packet parsing

Gaullier Nicolas nicolas.gaullier at cji.paris
Mon Jan 13 17:03:10 EET 2020


>>      if (CONFIG_SPDIF_DEMUXER && wav->spdif == 1)
>>          return ff_spdif_read_packet(s, pkt);
>> -    if (CONFIG_S337M_DEMUXER && wav->s337m == 1)
>> -        return ff_s337m_read_packet(s, pkt);
>>  
>>      if (wav->smv_data_ofs > 0) {
>>          int64_t audio_dts, video_dts; @@ -712,6 +710,10 @@ smv_out:
>>          wav->data_end = avio_tell(s->pb) + left;
>>      }
>>  
>> +    if (CONFIG_S337M_DEMUXER && wav->s337m == 1) {
>> +        size = FFMIN(S337M_MAX_OFFSET, left);
>> +        ret  = ff_s337m_get_packet(s->pb, pkt, size, NULL, s, st->codecpar->bits_per_coded_sample);
>> +    } else {
>
>Couldn't you roll this into the patch that adds the call to ff_s337m_read_packet()?

OK. I was not sure about it. I thought it might have been interesting to keep s337m as close as possible to spdif as long as possible, and then only fork at the very end with this last patch, but maybe it is does not make so much sense. Thus, I will move ff_s337m_read_packet() back to a static s337m_read_packet(), I think this is better as indeed s337m_read_packet should never be used from outside when s337m is submuxed in another mux because it does not restrict the available size that could be read from avio.
Nicolas


More information about the ffmpeg-devel mailing list