Commit 71bb53a6 authored by Committed by GStreamer Merge Bot
mpegaudioparse: Use a constant bit rate to convert between time and bytes if possible.
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. 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/gstreamer!374>, still audibly incorrect. This patch yields a much closer position, no longer audibly incorrect, and likely within a frame of the most correct position.
Showing with 21 additions and 0 deletions