[vlc-commits] [Git][videolan/vlc][master] 2 commits: cdda: count the time based on the number of audio sectors read
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Wed Feb 2 21:37:12 UTC 2022
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
a52e1064 by Steve Lhomme at 2022-02-02T21:09:54+00:00
cdda: count the time based on the number of audio sectors read
Rather than the number of samples which depends directly on it.
- - - - -
b6d7c88c by Steve Lhomme at 2022-02-02T21:09:54+00:00
cdda: reset the pts date after SET_POSITION/SET_TIME calls
- - - - -
1 changed file:
- modules/access/cdda.c
Changes:
=====================================
modules/access/cdda.c
=====================================
@@ -186,7 +186,7 @@ static int Demux(demux_t *demux)
block->i_nb_samples = block->i_buffer / 4;
block->i_dts = block->i_pts = date_Get(&sys->pts);
- date_Increment(&sys->pts, block->i_nb_samples);
+ date_Increment(&sys->pts, count);
es_out_Send(demux->out, sys->es, block);
es_out_SetPCR(demux->out, date_Get(&sys->pts));
@@ -219,6 +219,8 @@ static int DemuxControl(demux_t *demux, int query, va_list args)
case DEMUX_SET_POSITION:
sys->position = lround(va_arg(args, double) * sys->length);
+ date_Set(&sys->pts, VLC_TICK_0);
+ date_Increment(&sys->pts, sys->position);
break;
case DEMUX_GET_LENGTH:
@@ -229,6 +231,8 @@ static int DemuxControl(demux_t *demux, int query, va_list args)
break;
case DEMUX_SET_TIME:
sys->position = samples_from_vlc_tick(va_arg(args, vlc_tick_t), CD_ROM_CDDA_FRAMES);
+ date_Set(&sys->pts, VLC_TICK_0);
+ date_Increment(&sys->pts, sys->position);
break;
default:
@@ -349,7 +353,7 @@ static int DemuxOpen(vlc_object_t *obj, vcddev_t *dev, unsigned track)
fmt.audio.i_channels = 2;
sys->es = es_out_Add(demux->out, &fmt);
- date_Init(&sys->pts, 44100, 1);
+ date_Init(&sys->pts, CD_ROM_CDDA_FRAMES, 1);
date_Set(&sys->pts, VLC_TICK_0);
sys->position = 0;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/201eaaed4ae412edb04d15a6d5105a8768c242a5...b6d7c88cf84bd5ac280dc152d4ae4de842bc4a25
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/201eaaed4ae412edb04d15a6d5105a8768c242a5...b6d7c88cf84bd5ac280dc152d4ae4de842bc4a25
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list