mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
libeplayer3: experimental fixes
Origin commit data
------------------
Branch: master
Commit: d481adb2b8
Author: martii <m4rtii@gmx.de>
Date: 2013-01-17 (Thu, 17 Jan 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -14,7 +14,11 @@
|
||||
#define PES_VERSION_FAKE_START_CODE 0x31
|
||||
|
||||
|
||||
#ifdef MARTII
|
||||
#define MAX_PES_PACKET_SIZE (6+65535)
|
||||
#else
|
||||
#define MAX_PES_PACKET_SIZE 65400
|
||||
#endif
|
||||
|
||||
|
||||
/* start codes */
|
||||
|
@@ -37,6 +37,9 @@
|
||||
#include <asm/types.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#ifdef MARTII
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "output.h"
|
||||
@@ -246,17 +249,38 @@ static int writeData(void* _call)
|
||||
{
|
||||
aac_printf(10, "private_data = NULL\n");
|
||||
|
||||
#ifdef MARTII
|
||||
memcpy (ExtraData, DefaultAACHeader, AAC_HEADER_LENGTH);
|
||||
#else
|
||||
call->private_data = DefaultAACHeader;
|
||||
call->private_size = AAC_HEADER_LENGTH;
|
||||
#endif
|
||||
}
|
||||
#ifdef MARTII
|
||||
else
|
||||
#endif
|
||||
|
||||
memcpy (ExtraData, call->private_data, AAC_HEADER_LENGTH);
|
||||
#ifdef MARTII
|
||||
ExtraData[3] |= (PacketLength >> 11) & 0x3;
|
||||
#else
|
||||
ExtraData[3] |= (PacketLength >> 12) & 0x3;
|
||||
#endif
|
||||
ExtraData[4] = (PacketLength >> 3) & 0xff;
|
||||
ExtraData[5] |= (PacketLength << 5) & 0xe0;
|
||||
|
||||
unsigned int HeaderLength = InsertPesHeader (PesHeader, PacketLength, AAC_AUDIO_PES_START_CODE, call->Pts, 0);
|
||||
|
||||
#ifdef MARTII
|
||||
struct iovec iov[3];
|
||||
iov[0].iov_base = PesHeader;
|
||||
iov[0].iov_len = HeaderLength;
|
||||
iov[1].iov_base = ExtraData;
|
||||
iov[1].iov_len = AAC_HEADER_LENGTH;
|
||||
iov[2].iov_base = call->data;
|
||||
iov[2].iov_len = call->len;
|
||||
return writev(call->fd, iov, 3);
|
||||
#else
|
||||
unsigned char* PacketStart = malloc(HeaderLength + sizeof(ExtraData) + call->len);
|
||||
memcpy (PacketStart, PesHeader, HeaderLength);
|
||||
memcpy (PacketStart + HeaderLength, ExtraData, sizeof(ExtraData));
|
||||
@@ -269,6 +293,7 @@ static int writeData(void* _call)
|
||||
free(PacketStart);
|
||||
|
||||
return len;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ***************************** */
|
||||
|
Reference in New Issue
Block a user