mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
fix codec parameters handling for compatibility with FFmpeg versions 59.37.100 and above
Origin commit data
------------------
Branch: master
Commit: 15d5c0c94d
Author: GetAway <get-away@t-online.de>
Date: 2024-11-12 (Tue, 12 Nov 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,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pcmPrivateData_t pcmExtradata;
|
pcmPrivateData_t pcmExtradata;
|
||||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 37, 100)
|
||||||
pcmExtradata.channels = get_codecpar(audioTrack->stream)->ch_layout.nb_channels;
|
pcmExtradata.channels = get_codecpar(audioTrack->stream)->ch_layout.nb_channels;
|
||||||
#else
|
#else
|
||||||
pcmExtradata.channels = get_codecpar(audioTrack->stream)->channels;
|
pcmExtradata.channels = get_codecpar(audioTrack->stream)->channels;
|
||||||
@@ -1168,7 +1168,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
swr = swr_alloc();
|
swr = swr_alloc();
|
||||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 37, 100)
|
||||||
out_channels = c->ch_layout.nb_channels;
|
out_channels = c->ch_layout.nb_channels;
|
||||||
|
|
||||||
if (c->ch_layout.u.mask == 0)
|
if (c->ch_layout.u.mask == 0)
|
||||||
@@ -1200,7 +1200,7 @@ 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)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 37, 100)
|
||||||
av_opt_set_int(swr, "in_channel_layout", c->ch_layout.u.mask, 0);
|
av_opt_set_int(swr, "in_channel_layout", c->ch_layout.u.mask, 0);
|
||||||
#else
|
#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);
|
||||||
@@ -1242,7 +1242,7 @@ 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)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 37, 100)
|
||||||
pcmExtradata.channels = c->ch_layout.nb_channels;
|
pcmExtradata.channels = c->ch_layout.nb_channels;
|
||||||
#else
|
#else
|
||||||
pcmExtradata.channels = av_get_channel_layout_nb_channels(out_channel_layout);
|
pcmExtradata.channels = av_get_channel_layout_nb_channels(out_channel_layout);
|
||||||
@@ -2477,7 +2477,7 @@ 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)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 37, 100)
|
||||||
int32_t chan_config = get_chan_config(get_codecpar(stream)->ch_layout.nb_channels);
|
int32_t chan_config = get_chan_config(get_codecpar(stream)->ch_layout.nb_channels);
|
||||||
#else
|
#else
|
||||||
int32_t chan_config = get_chan_config(get_codecpar(stream)->channels);
|
int32_t chan_config = get_chan_config(get_codecpar(stream)->channels);
|
||||||
|
Reference in New Issue
Block a user