mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
Replace the AAC Main object type to the AAC LC in the ADTS header - workaround for no audio on some TS'streams
Signed-off-by: max_10 <max_10@gmx.de>
This commit is contained in:
@@ -638,7 +638,7 @@ int main(int argc, char *argv[])
|
|||||||
memset(argvBuff, '\0', sizeof(argvBuff));
|
memset(argvBuff, '\0', sizeof(argvBuff));
|
||||||
int commandRetVal = -1;
|
int commandRetVal = -1;
|
||||||
/* inform client that we can handle additional commands */
|
/* inform client that we can handle additional commands */
|
||||||
fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 42);
|
fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 43);
|
||||||
if (0 != ParseParams(argc, argv, file, audioFile, &audioTrackIdx, &subtitleTrackIdx, &linuxDvbBufferSizeMB))
|
if (0 != ParseParams(argc, argv, file, audioFile, &audioTrackIdx, &subtitleTrackIdx, &linuxDvbBufferSizeMB))
|
||||||
{
|
{
|
||||||
printf("Usage: exteplayer3 filePath [-u user-agent] [-c cookies] [-h headers] [-p prio] [-a] [-d] [-w] [-l] [-s] [-i] [-t audioTrackId] [-9 subtitleTrackId] [-x separateAudioUri] plabackUri\n");
|
printf("Usage: exteplayer3 filePath [-u user-agent] [-c cookies] [-h headers] [-p prio] [-a] [-d] [-w] [-l] [-s] [-i] [-t audioTrackId] [-9 subtitleTrackId] [-x separateAudioUri] plabackUri\n");
|
||||||
|
@@ -177,6 +177,14 @@ static int _writeData(WriterAVCallData_t *call, int type)
|
|||||||
aac_err("parsing Data with missing syncword. ignoring...\n");
|
aac_err("parsing Data with missing syncword. ignoring...\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// STB can handle only AAC LC profile
|
||||||
|
if (0 == (call->data[2] & 0xC0))
|
||||||
|
{
|
||||||
|
// change profile AAC Main -> AAC LC (Low Complexity)
|
||||||
|
aac_printf(1, "change profile AAC Main -> AAC LC (Low Complexity) in the ADTS header");
|
||||||
|
call->data[2] = (call->data[2] & 0x1F) | 0x40;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // check LOAS header
|
else // check LOAS header
|
||||||
{
|
{
|
||||||
@@ -219,6 +227,9 @@ static int writeDataADTS(WriterAVCallData_t *call)
|
|||||||
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
|
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
|
||||||
HasADTSHeader(call->data, call->len))
|
HasADTSHeader(call->data, call->len))
|
||||||
{
|
{
|
||||||
|
//(aacbuf[2] & 0x1F) | 0x40
|
||||||
|
|
||||||
|
//printf("%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx\n", call->data[0], call->data[1], call->data[2], call->data[3], call->data[4], call->data[5], call->data[6], call->data[7]);
|
||||||
return _writeData(call, 0);
|
return _writeData(call, 0);
|
||||||
}
|
}
|
||||||
uint32_t PacketLength = call->len + AAC_HEADER_LENGTH;
|
uint32_t PacketLength = call->len + AAC_HEADER_LENGTH;
|
||||||
|
@@ -176,6 +176,14 @@ static int _writeData(void *_call, int type)
|
|||||||
aac_err("parsing Data with missing syncword. ignoring...\n");
|
aac_err("parsing Data with missing syncword. ignoring...\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// STB can handle only AAC LC profile
|
||||||
|
if (0 == (call->data[2] & 0xC0))
|
||||||
|
{
|
||||||
|
// change profile AAC Main -> AAC LC (Low Complexity)
|
||||||
|
aac_printf(1, "change profile AAC Main -> AAC LC (Low Complexity) in the ADTS header");
|
||||||
|
call->data[2] = (call->data[2] & 0x1F) | 0x40;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // check LOAS header
|
else // check LOAS header
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user