[FFmpeg-devel] [PATCH 088/281] libcdio: port to new channel layout API
James Almer
jamrial at gmail.com
Thu Jan 13 03:50:50 EET 2022
From: Anton Khirnov <anton at khirnov.net>
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavdevice/libcdio.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c
index 623878fe7f..4417523c57 100644
--- a/libavdevice/libcdio.c
+++ b/libavdevice/libcdio.c
@@ -90,13 +90,14 @@ static av_cold int read_header(AVFormatContext *ctx)
else
st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;
st->codecpar->sample_rate = 44100;
- st->codecpar->channels = 2;
+ st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
if (s->drive->audio_last_sector != CDIO_INVALID_LSN &&
s->drive->audio_first_sector != CDIO_INVALID_LSN)
st->duration = s->drive->audio_last_sector - s->drive->audio_first_sector;
else if (s->drive->tracks)
st->duration = s->drive->disc_toc[s->drive->tracks].dwStartSector;
- avpriv_set_pts_info(st, 64, CDIO_CD_FRAMESIZE_RAW, 2 * st->codecpar->channels * st->codecpar->sample_rate);
+ avpriv_set_pts_info(st, 64, CDIO_CD_FRAMESIZE_RAW,
+ 2 * st->codecpar->ch_layout.nb_channels * st->codecpar->sample_rate);
for (i = 0; i < s->drive->tracks; i++) {
char title[16];
--
2.34.1
More information about the ffmpeg-devel
mailing list