libeplayer3: sync with max_10

Origin commit data
------------------
Branch: master
Commit: 61a2a148d5
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-01-24 (Tue, 24 Jan 2023)

Origin message was:
------------------
- libeplayer3: sync with max_10

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-01-24 21:00:47 +01:00
parent 85d1f1edf4
commit 272d5b11ce
65 changed files with 1100 additions and 959 deletions

View File

@@ -32,7 +32,6 @@
#include <ffmpeg/put_bits.h>
#include <string.h>
void avpriv_align_put_bits(PutBitContext *s)
{
put_bits(s, s->bit_left & 7, 0);

View File

@@ -79,8 +79,22 @@ static inline int get_sample_rate(GetBitContext *gb, int *index)
return *index == 0x0f ? (int)get_bits(gb, 24) : avpriv_mpeg4audio_sample_rates[*index];
}
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
int bit_size, int sync_extension)
uint8_t get_chan_config(int channels)
{
uint8_t chan_config = 0;
unsigned int i;
for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
{
if (channels == ff_mpeg4audio_channels[i])
{
chan_config = i;
break;
}
}
return chan_config;
}
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int bit_size, int sync_extension)
{
GetBitContext gb;
int specific_config_bitindex, ret;
@@ -100,8 +114,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
c->sbr = -1;
c->ps = -1;
if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&
// check for W6132 Annex YYYY draft MP3onMP4
!(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F))))
// check for W6132 Annex YYYY draft MP3onMP4
!(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F))))
{
if (c->object_type == AOT_PS)
c->ps = 1;
@@ -164,9 +178,7 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
return specific_config_bitindex;
}
static av_always_inline unsigned int copy_bits(PutBitContext *pb,
GetBitContext *gb,
int bits)
static av_always_inline unsigned int copy_bits(PutBitContext *pb, GetBitContext *gb, int bits)
{
unsigned int el = get_bits(gb, bits);
put_bits(pb, bits, el);