mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
Add a new channel layout API ffmpeg 7.0;pleas check line 1176:av_channel_layout_default
Origin commit data
------------------
Branch: master
Commit: 03dd326d76
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2024-09-02 (Mon, 02 Sep 2024)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1022,7 +1022,11 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pcmPrivateData_t pcmExtradata;
|
pcmPrivateData_t pcmExtradata;
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||||
|
pcmExtradata.channels = get_codecpar(audioTrack->stream)->ch_layout.nb_channels;
|
||||||
|
#else
|
||||||
pcmExtradata.channels = get_codecpar(audioTrack->stream)->channels;
|
pcmExtradata.channels = get_codecpar(audioTrack->stream)->channels;
|
||||||
|
#endif
|
||||||
pcmExtradata.bits_per_coded_sample = get_codecpar(audioTrack->stream)->bits_per_coded_sample;
|
pcmExtradata.bits_per_coded_sample = get_codecpar(audioTrack->stream)->bits_per_coded_sample;
|
||||||
pcmExtradata.sample_rate = get_codecpar(audioTrack->stream)->sample_rate;
|
pcmExtradata.sample_rate = get_codecpar(audioTrack->stream)->sample_rate;
|
||||||
pcmExtradata.bit_rate = get_codecpar(audioTrack->stream)->bit_rate;
|
pcmExtradata.bit_rate = get_codecpar(audioTrack->stream)->bit_rate;
|
||||||
@@ -1164,6 +1168,16 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
swr = swr_alloc();
|
swr = swr_alloc();
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||||
|
out_channels = c->ch_layout.nb_channels;
|
||||||
|
|
||||||
|
if (c->ch_layout.u.mask == 0)
|
||||||
|
{
|
||||||
|
av_channel_layout_default(&c->ch_layout, c->ch_layout.nb_channels);
|
||||||
|
}
|
||||||
|
|
||||||
|
out_channel_layout = c->ch_layout.u.mask;
|
||||||
|
#else
|
||||||
out_channels = c->channels;
|
out_channels = c->channels;
|
||||||
|
|
||||||
if (c->channel_layout == 0)
|
if (c->channel_layout == 0)
|
||||||
@@ -1172,7 +1186,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
out_channel_layout = c->channel_layout;
|
out_channel_layout = c->channel_layout;
|
||||||
|
#endif
|
||||||
uint8_t downmix = stereo_software_decoder && out_channels > 2 ? 1 : 0;
|
uint8_t downmix = stereo_software_decoder && out_channels > 2 ? 1 : 0;
|
||||||
#ifdef __sh__
|
#ifdef __sh__
|
||||||
// player2 won't play mono
|
// player2 won't play mono
|
||||||
@@ -1186,8 +1200,11 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
out_channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX;
|
out_channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX;
|
||||||
out_channels = 2;
|
out_channels = 2;
|
||||||
}
|
}
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||||
|
av_opt_set_int(swr, "in_channel_layout", c->ch_layout.u.mask, 0);
|
||||||
|
#else
|
||||||
av_opt_set_int(swr, "in_channel_layout", c->channel_layout, 0);
|
av_opt_set_int(swr, "in_channel_layout", c->channel_layout, 0);
|
||||||
|
#endif
|
||||||
av_opt_set_int(swr, "out_channel_layout", out_channel_layout, 0);
|
av_opt_set_int(swr, "out_channel_layout", out_channel_layout, 0);
|
||||||
av_opt_set_int(swr, "in_sample_rate", c->sample_rate, 0);
|
av_opt_set_int(swr, "in_sample_rate", c->sample_rate, 0);
|
||||||
av_opt_set_int(swr, "out_sample_rate", out_sample_rate, 0);
|
av_opt_set_int(swr, "out_sample_rate", out_sample_rate, 0);
|
||||||
@@ -1225,7 +1242,11 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Update pcmExtradata according to decode parameters
|
// Update pcmExtradata according to decode parameters
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||||
|
pcmExtradata.channels = c->ch_layout.nb_channels;
|
||||||
|
#else
|
||||||
pcmExtradata.channels = av_get_channel_layout_nb_channels(out_channel_layout);
|
pcmExtradata.channels = av_get_channel_layout_nb_channels(out_channel_layout);
|
||||||
|
#endif
|
||||||
pcmExtradata.bits_per_coded_sample = 16;
|
pcmExtradata.bits_per_coded_sample = 16;
|
||||||
pcmExtradata.sample_rate = out_sample_rate;
|
pcmExtradata.sample_rate = out_sample_rate;
|
||||||
// The data described by the sample format is always in native-endian order
|
// The data described by the sample format is always in native-endian order
|
||||||
@@ -2456,7 +2477,11 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
|||||||
|
|
||||||
int32_t object_type = 2; // LC
|
int32_t object_type = 2; // LC
|
||||||
int32_t sample_index = aac_get_sample_rate_index(get_codecpar(stream)->sample_rate);
|
int32_t sample_index = aac_get_sample_rate_index(get_codecpar(stream)->sample_rate);
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||||
|
int32_t chan_config = get_chan_config(get_codecpar(stream)->ch_layout.nb_channels);
|
||||||
|
#else
|
||||||
int32_t chan_config = get_chan_config(get_codecpar(stream)->channels);
|
int32_t chan_config = get_chan_config(get_codecpar(stream)->channels);
|
||||||
|
#endif
|
||||||
ffmpeg_printf(1, "aac object_type %d\n", object_type);
|
ffmpeg_printf(1, "aac object_type %d\n", object_type);
|
||||||
ffmpeg_printf(1, "aac sample_index %d\n", sample_index);
|
ffmpeg_printf(1, "aac sample_index %d\n", sample_index);
|
||||||
ffmpeg_printf(1, "aac chan_config %d\n", chan_config);
|
ffmpeg_printf(1, "aac chan_config %d\n", chan_config);
|
||||||
|
Reference in New Issue
Block a user