Commit Graph

5 Commits

Author SHA1 Message Date
Anton Khirnov 0ed1eeb744 lavf/dv: use a more granular timebase for audio
One that is fine enough to represent all DV audio sample rates. Audio
packet durations are now sample-accurate.

This largely undoes commit 76fbb0052d. To
avoid breaking the issue fixed by that commit, resync audio timestamps
against video if they get more than one frame apart. The sample from
issue #8762 still works correctly after this commit.

Slightly changes the results of the lavf-dv seektest, due to the audio
timebase being more granular.
2023-05-02 10:57:21 +02:00
Anton Khirnov c7a852b638 lavf/dv: do not set video timebase more than once
Current code will call avpriv_set_pts_info() for each video frame,
possibly setting a different timebase if the stream framerate changes.
This violates API conventions, as the timebase is supposed to stay
constant after stream creation.

Change the demuxer to set a single timebase that is fine enough to
handle all supported DV framerates.

The seek tests change slightly because the new timebase is more
granular.
2023-05-02 10:57:21 +02:00
Marton Balint 76fbb0052d avformat/dv: fix timestamps of audio packets in case of dropped corrupt audio frames
By using the frame counter (and the video time base) for audio pts we lose some
timestamp precision but we ensure that video and audio coming from the same DV
frame are always in sync.

This patch also makes timestamps after seek consistent and it should also fix
the timestamps when the audio clock is unlocked and have a completely
indpendent clock source. (E.g. runs on fixed 48009 Hz which should have been
exact 48000 Hz)

Fixes out of sync timestamps in ticket #8762.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-12-06 18:09:24 +01:00
James Almer fda424b300 Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c'
* commit '618d02c1fa9e74d490cace64a7d15762656b521c':
  tests: Convert lavf container tests to non-legacy test scripts

Merged-by: James Almer <jamrial@gmail.com>
2019-03-14 14:36:24 -03:00
Diego Biurrun 618d02c1fa tests: Convert lavf container tests to non-legacy test scripts
Rename some tests in the process for consistency and simplicity.
2019-02-16 18:15:46 +01:00