Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 19:31:51 +0300
committerJames Almer <jamrial@gmail.com>2022-03-15 15:42:37 +0300
commit677fea79b794236a3d791120d0ba3c832caedb17 (patch)
treeb3c698fae5c197637a6a2a898a6a9803f71114dd /libavformat/smacker.c
parent736a45f8985e3a0f8163242d7af417fdcee30198 (diff)
smacker: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r--libavformat/smacker.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 98436bd708..80d36f2f40 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -186,13 +186,8 @@ static int smacker_read_header(AVFormatContext *s)
} else {
par->codec_id = AV_CODEC_ID_PCM_U8;
}
- if (aflag & SMK_AUD_STEREO) {
- par->channels = 2;
- par->channel_layout = AV_CH_LAYOUT_STEREO;
- } else {
- par->channels = 1;
- par->channel_layout = AV_CH_LAYOUT_MONO;
- }
+ av_channel_layout_default(&par->ch_layout,
+ !!(aflag & SMK_AUD_STEREO) + 1);
par->sample_rate = rate;
par->bits_per_coded_sample = (aflag & SMK_AUD_16BITS) ? 16 : 8;
if (par->bits_per_coded_sample == 16 &&
@@ -200,7 +195,7 @@ static int smacker_read_header(AVFormatContext *s)
par->codec_id = AV_CODEC_ID_PCM_S16LE;
else
smk->duration_size[i] = 4;
- avpriv_set_pts_info(ast, 64, 1, par->sample_rate * par->channels
+ avpriv_set_pts_info(ast, 64, 1, par->sample_rate * par->ch_layout.nb_channels
* par->bits_per_coded_sample / 8);
}
}