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:
samsamsam
2018-04-03 00:00:54 +02:00
committed by Thilo Graf
parent 93f61a89f6
commit 98195bba11
3 changed files with 21 additions and 2 deletions

View File

@@ -638,7 +638,7 @@ int main(int argc, char *argv[])
memset(argvBuff, '\0', sizeof(argvBuff));
int commandRetVal = -1;
/* 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))
{
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");

View File

@@ -177,6 +177,14 @@ static int _writeData(WriterAVCallData_t *call, int type)
aac_err("parsing Data with missing syncword. ignoring...\n");
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
{
@@ -217,8 +225,11 @@ static int writeDataADTS(WriterAVCallData_t *call)
return 0;
}
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);
}
uint32_t PacketLength = call->len + AAC_HEADER_LENGTH;

View File

@@ -176,6 +176,14 @@ static int _writeData(void *_call, int type)
aac_err("parsing Data with missing syncword. ignoring...\n");
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
{