From 60dd75397f1ce9c4a56e74ee0bb94cebd4ab831c Mon Sep 17 00:00:00 2001 From: Tuomas Virtanen Date: Sat, 23 Jun 2018 17:53:11 +0300 Subject: Implement new API for subtitle screen size and stream indexes --- src/internal/audio/kitaudio.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/internal/audio/kitaudio.c') diff --git a/src/internal/audio/kitaudio.c b/src/internal/audio/kitaudio.c index 74fd024..2071bc5 100644 --- a/src/internal/audio/kitaudio.c +++ b/src/internal/audio/kitaudio.c @@ -168,16 +168,17 @@ static void dec_close_audio_cb(Kit_Decoder *dec) { free(audio_dec); } -Kit_Decoder* Kit_CreateAudioDecoder(const Kit_Source *src, Kit_AudioFormat *format) { +Kit_Decoder* Kit_CreateAudioDecoder(const Kit_Source *src, int stream_index, Kit_AudioFormat *format) { assert(src != NULL); assert(format != NULL); - if(src->audio_stream_index < 0) { + if(stream_index < 0) { return NULL; } // First the generic decoder component ... Kit_Decoder *dec = Kit_CreateDecoder( - src, src->audio_stream_index, + src, + stream_index, KIT_AUDIO_OUT_SIZE, free_out_audio_packet_cb); if(dec == NULL) { @@ -187,7 +188,7 @@ Kit_Decoder* Kit_CreateAudioDecoder(const Kit_Source *src, Kit_AudioFormat *form // Find formats format->samplerate = dec->codec_ctx->sample_rate; format->is_enabled = true; - format->stream_index = src->audio_stream_index; + format->stream_index = stream_index; format->channels = _FindChannelLayout(dec->codec_ctx->channel_layout); _FindAudioFormat(dec->codec_ctx->sample_fmt, &format->bytes, &format->is_signed, &format->format); -- cgit v1.2.3