On Wed, Sep 27, 2023 at 2:51 PM Andreas Rheinhardt < andreas.rheinha...@outlook.com> wrote:
> Paul B Mahol: > > On Sun, Sep 24, 2023 at 2:04 AM Andreas Rheinhardt < > > andreas.rheinha...@outlook.com> wrote: > > > >> Paul B Mahol: > >>> > >>> + if (!qoa->frame_size) { > >>> + for (; i < buf_size; i++) { > >>> + state = (state << 8) | buf[i]; > >>> + if (((state & 0xFFFF) > 0 && (state >> 56))) { > >>> + qoa->frame_size = state & 0xFFFF; > >>> + qoa->duration = (state >> 16) & 0xFFFF; > >>> + break; > >>> + } > >>> + } > >>> + } > >> > >> So this codec uses a length field. In this case it is quite simple to > >> avoid the parser (and its implicit memcpy) altogether and just make the > >> demuxer directly output packets of the correct size. This is quite > >> natural given that this format does not seem to provide any features > >> like resyncing support (or at least the parser does not implement them). > >> > > > > But channels/sample rate may differ between packets. > > And? > > > Also it may be in other formats, like wav. So I picked parser as more > > valuable implementation. > > > > Then you could simply reuse the code inside libavformat. > What code? I think that having parser is much more useful. > > - Andreas > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".