mirror of https://github.com/mpv-player/mpv
audio: fix timestamps
Accidentally broken in b6af44d3
. For ad_lavc (and in general), the PTS
was not updated correctly when filtering only parts of audio frames,
and for ad_mpg123 and ad_spdif the PTS was additionally offset by the
frame size.
This could lead to incorrect time display, and possibly broken A/V sync.
This commit is contained in:
parent
fc28e4af4d
commit
69eb056333
|
@ -257,7 +257,6 @@ static int decode_packet(struct dec_audio *da)
|
|||
int got_samples = bytes / con->sample_size;
|
||||
da->decoded.planes[0] = audio;
|
||||
da->decoded.samples = got_samples;
|
||||
da->pts_offset += got_samples;
|
||||
|
||||
update_info(da);
|
||||
return 0;
|
||||
|
|
|
@ -211,7 +211,6 @@ static int decode_packet(struct dec_audio *da)
|
|||
|
||||
da->decoded.planes[0] = spdif_ctx->out_buffer;
|
||||
da->decoded.samples = spdif_ctx->out_buffer_len / da->decoded.sstride;
|
||||
da->pts_offset += da->decoded.samples;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -262,6 +262,7 @@ static int filter_n_bytes(struct dec_audio *da, struct mp_audio_buffer *outbuf,
|
|||
append.samples = copy;
|
||||
mp_audio_buffer_append(da->decode_buffer, &append);
|
||||
mp_audio_skip_samples(&da->decoded, copy);
|
||||
da->pts_offset += copy;
|
||||
continue;
|
||||
}
|
||||
error = da->ad_driver->decode_packet(da);
|
||||
|
|
Loading…
Reference in New Issue