Skip to content

mpegaudioparse: Use a constant bit rate to convert between time and bytes if possible.

Zeb Figura requested to merge zfigura/gst-plugins-good:master into master

This should result in no worse accuracy than the base parse element, and may result in better accuracy. In particular, the number of bytes processed at any given point, as accumulated by baseparse, can be only accurate to (1 / # of frames) bytes per second, and if we try to seek immediately after pausing the pipeline to a large offset, this small inaccuracy can propagate to something noticeable.

I don't know how likely it is that a file without a seek table is nevertheless VBR, but logically it can't be that likely.

The use case that prompted this patch is a 45-minute MPEG-1 layer 3 file, which has a constant bit rate but no seek tables. Trying to seek the pipeline immediately after pauisng it, without the ACCURATE flag, to a location 41 minutes in, yields a location that is, even with gstreamer!374 (merged), still audibly incorrect. This patch yields a much closer position, no longer audibly incorrect, and likely within a frame of the most correct position.

Merge request reports