Matthieu Bouron
2e17435480
avformat/mov: adjust skip_samples according to seek timestamp
...
Currently skip_samples is set to start_pad if sample_time is lesser or
equal to 0. This can cause issues if the stream starts with packets that
have negative pts. Calling avformat_seek_file() with ts set to 0 on such
streams makes the mov demuxer return the right corresponding packets
(near the 0 timestamp) but set skip_samples to start_pad which is
incorrect as the audio decoder will discard the returned samples
according to skip_samples from the first packet it receives (which has
its timestamp near 0).
For example, considering the following audio stream with start_pad=1344:
[PKT pts=-1344] [PKT pts=-320] [PKT pts=704] [PKT pts=1728] [...]
Calling avformat_seek_file() with ts=0 makes the next call to
av_read_frame() return the packet with pts=-320 and a skip samples
side data set to 1344 (start_pad). This makes the audio decoder
incorrectly discard (1344 - 320) samples.
This commit makes the move demuxer adjust skip_samples according to the
stream start_pad, seek timestamp and first sample timestamp.
The above example will now result in av_read_frame() still returning the
packet with pts=-320 but with a skip samples side data set to 320
(src_pad - (seek_timestamp - first_timestamp)). This makes the audio
decoder only discard 320 samples (from pts=-320 to pts=0).
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-01-09 17:08:27 +01:00
..
2020-10-28 21:34:09 +01:00
2020-09-19 00:55:04 +02:00
2020-09-20 20:06:55 +02:00
2020-10-03 21:50:59 +02:00
2020-08-30 16:18:37 +02:00
2020-10-03 21:49:39 +02:00
2020-11-04 23:30:53 +01:00
2020-09-15 09:53:39 -03:00
2020-12-06 20:03:47 +11:00
2020-10-25 23:44:26 +10:00
2020-11-09 14:58:38 +10:00
2020-10-28 14:59:28 +01:00
2020-07-30 11:48:28 +10:00
2020-11-03 14:27:25 +01:00
2020-06-22 12:20:37 +02:00
2020-09-27 09:11:29 +10:00
2020-09-27 09:11:29 +10:00
2020-11-05 07:58:06 +10:00
2020-10-28 14:59:28 +01:00
2020-11-15 18:20:59 +01:00
2020-07-15 20:52:01 +05:30
2020-11-10 16:37:37 +01:00
2020-11-24 10:13:55 +02:00
2020-12-06 21:00:03 +01:00
2020-06-26 12:13:43 +02:00
2020-06-26 12:13:43 +02:00
2020-10-28 15:01:40 +01:00
2020-11-10 16:37:37 +01:00
2020-07-15 20:52:01 +05:30
2020-10-09 21:07:18 +02:00
2020-11-12 14:05:43 +02:00
2020-10-06 00:01:35 +08:00
2020-10-06 00:01:27 +08:00
2020-11-22 17:45:17 +01:00
2020-10-23 10:07:57 +02:00
2020-10-28 14:59:28 +01:00
2020-11-11 17:05:24 +01:00
2020-10-20 15:33:13 +02:00
2020-09-12 14:52:31 +02:00
2020-12-24 15:25:00 +01:00
2020-09-13 16:05:01 +02:00
2020-10-28 14:59:28 +01:00
2020-10-28 11:59:35 -03:00
2020-11-03 00:46:59 +01:00
2020-07-20 10:14:53 +08:00
2020-10-20 11:41:44 +08:00
2020-08-31 23:43:06 +02:00
2020-07-26 16:57:58 +02:00
2021-01-08 18:08:57 +01:00
2020-12-06 21:00:03 +01:00
2020-09-13 17:51:57 +02:00
2020-12-06 18:09:24 +01:00
2020-11-19 22:39:30 +08:00
2020-10-02 14:59:53 +02:00
2020-10-25 09:05:01 +01:00
2020-10-21 17:21:41 +02:00
2020-10-28 14:59:28 +01:00
2020-11-26 13:32:30 +01:00
2020-10-28 14:59:28 +01:00
2020-10-28 14:59:28 +01:00
2020-06-22 12:20:37 +02:00
2020-12-08 18:54:20 +01:00
2020-10-24 19:11:12 +02:00
2020-07-08 23:09:29 +08:00
2020-11-04 23:30:53 +01:00
2021-01-08 05:06:11 +01:00
2020-07-02 02:09:59 +02:00
2020-12-28 11:09:17 +08:00
2020-12-08 21:02:23 +08:00
2020-12-28 11:09:19 +08:00
2021-01-03 16:47:29 +01:00
2020-07-02 17:14:31 +02:00
2020-11-13 17:46:47 +01:00
2020-12-05 00:08:33 +01:00
2020-12-12 00:13:58 +01:00
2020-10-28 14:59:28 +01:00
2020-10-07 22:16:09 +02:00
2020-12-24 13:16:44 +01:00
2020-10-28 15:01:40 +01:00
2020-09-24 13:38:28 +02:00
2020-10-12 12:19:29 +02:00
2020-11-05 21:40:20 +05:30
2020-10-30 14:06:19 +01:00
2020-10-28 14:59:28 +01:00
2020-10-18 21:27:23 +02:00
2020-10-28 13:53:23 +01:00
2020-12-21 01:27:33 -05:00
2020-10-08 22:56:31 +02:00
2020-10-16 23:15:09 +02:00
2020-10-25 09:49:26 +01:00
2020-09-18 11:30:03 +02:00
2020-11-10 16:37:37 +01:00
2020-12-22 18:03:18 -05:00
2020-12-09 21:41:15 +01:00
2020-07-15 20:52:01 +05:30
2020-09-10 17:38:08 +02:00
2020-06-18 21:31:13 +02:00
2020-06-25 12:50:22 +02:00
2020-10-28 14:59:28 +01:00
2020-07-10 20:36:31 +02:00
2020-09-03 18:11:00 +02:00
2020-11-22 17:45:17 +01:00
2021-01-09 17:08:27 +01:00
2020-11-22 14:28:31 +02:00
2020-10-28 14:59:28 +01:00
2020-09-15 09:53:39 -03:00
2020-12-05 00:08:33 +01:00
2020-10-28 14:59:28 +01:00
2020-10-28 14:57:01 +01:00
2020-12-28 19:36:57 +01:00
2020-10-16 23:31:45 +02:00
2020-10-30 22:41:59 +08:00
2020-10-09 21:07:18 +02:00
2020-06-22 13:16:53 +02:00
2020-06-15 16:54:05 +02:00
2020-12-06 20:03:47 +11:00
2020-09-03 18:03:18 +02:00
2020-12-10 09:50:18 +01:00
2020-10-28 14:59:28 +01:00
2020-10-24 19:11:12 +02:00
2021-01-08 05:05:13 +01:00
2021-01-08 05:05:13 +01:00
2021-01-08 05:05:13 +01:00
2021-01-08 05:05:13 +01:00
2020-10-24 19:11:12 +02:00
2020-10-28 14:59:28 +01:00
2020-08-22 22:51:07 +02:00
2020-10-28 14:59:28 +01:00
2020-10-28 14:59:28 +01:00
2020-10-19 11:54:45 -03:00
2020-11-04 23:30:53 +01:00
2020-10-25 09:49:31 +01:00
2020-06-22 13:16:58 +02:00
2020-08-20 13:27:22 +02:00
2020-12-11 00:23:41 +01:00
2020-12-06 21:00:03 +01:00
2020-09-22 18:37:15 +02:00
2020-07-15 20:52:01 +05:30
2020-10-21 11:23:23 +10:00
2020-10-28 14:59:28 +01:00
2020-11-21 22:09:51 +01:00
2020-12-09 21:41:15 +01:00
2020-10-30 17:49:51 +01:00
2020-08-25 19:29:34 +02:00
2021-01-03 20:30:33 -03:00
2020-06-22 12:20:37 +02:00
2020-10-22 20:53:56 +08:00
2020-12-28 14:08:44 -08:00
2020-12-28 14:08:44 -08:00
2020-12-28 14:08:44 -08:00
2020-12-05 09:00:53 +08:00
2020-06-15 16:54:05 +02:00
2020-11-11 17:05:24 +01:00
2020-06-22 13:17:02 +02:00
2020-10-01 22:45:34 -03:00
2020-10-28 14:59:28 +01:00
2020-07-26 17:10:06 +02:00
2020-09-10 13:44:12 +02:00
2020-08-09 19:07:23 +02:00
2020-08-20 13:27:22 +02:00
2020-07-28 06:29:58 +02:00
2020-07-07 15:15:34 +02:00
2020-06-27 23:19:58 +02:00
2020-06-15 16:54:06 +02:00
2020-06-15 16:54:06 +02:00
2020-06-15 16:54:06 +02:00
2020-10-15 18:44:31 +02:00
2020-09-13 16:05:01 +02:00
2020-09-20 18:34:48 +02:00
2020-12-24 15:25:00 +01:00
2020-09-20 18:34:48 +02:00
2020-09-20 16:58:17 +02:00
2020-12-07 13:34:06 +02:00
2020-11-05 09:22:17 +02:00
2020-11-05 09:22:17 +02:00
2020-11-05 09:22:17 +02:00
2020-11-05 09:22:17 +02:00
2020-11-05 09:22:17 +02:00
2020-11-05 09:22:17 +02:00
2020-10-28 14:59:28 +01:00
2020-09-15 09:53:39 -03:00
2020-08-11 16:44:11 +02:00
2020-10-22 20:53:57 +08:00
2020-12-16 22:45:28 +01:00
2020-08-12 16:45:21 +02:00
2021-01-08 18:02:55 +01:00
2021-01-03 16:47:29 +01:00
2021-01-05 02:00:05 +01:00
2020-10-28 14:59:28 +01:00
2020-06-15 16:54:06 +02:00
2020-12-05 00:08:33 +01:00
2021-01-03 01:16:25 +01:00
2020-09-20 18:03:52 +02:00
2020-07-26 16:47:01 +02:00
2020-06-26 07:48:10 +02:00
2020-09-13 17:51:57 +02:00
2020-10-21 17:21:41 +02:00
2020-07-15 20:52:01 +05:30
2020-09-21 11:53:25 +02:00
2020-10-30 17:46:34 +01:00
2020-09-04 17:34:44 +02:00