libeplayer: cleanup writers

This commit is contained in:
martii
2014-04-05 16:40:03 +02:00
parent 5f2f008800
commit 58b9518db1
10 changed files with 3 additions and 111 deletions

View File

@@ -97,18 +97,8 @@ static int writeData(WriterAVCallData_t *call)
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
if (call == NULL) {
ac3_err("call data is NULL...\n");
return 0;
}
ac3_printf(10, "AudioPts %lld\n", call->Pts);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
ac3_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
ac3_err("file pointer < 0. ignoring ...\n");
return 0;

View File

@@ -104,16 +104,6 @@ static int writeData(WriterAVCallData_t *call)
divx_printf(10, "\n");
if (call == NULL) {
divx_err("call data is NULL...\n");
return 0;
}
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
divx_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
divx_err("file pointer < 0. ignoring ...\n");
return 0;

View File

@@ -97,20 +97,8 @@ static int writeData(WriterAVCallData_t *call)
{
unsigned char PesHeader[PES_AUDIO_HEADER_SIZE];
dts_printf(10, "\n");
if (call == NULL) {
dts_err("call data is NULL...\n");
return 0;
}
dts_printf(10, "AudioPts %lld\n", call->Pts);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
dts_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
dts_err("file pointer < 0. ignoring ...\n");
return 0;

View File

@@ -93,13 +93,6 @@ static int writeData(WriterAVCallData_t *call)
{
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
flac_printf(10, "\n");
if (call == NULL) {
flac_err("call data is NULL...\n");
return 0;
}
flac_printf(10, "AudioPts %lld\n", call->Pts);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
@@ -114,9 +107,7 @@ static int writeData(WriterAVCallData_t *call)
struct iovec iov[2];
iov[0].iov_base = PesHeader;
iov[0].iov_len =
InsertPesHeader(PesHeader, call->packet->size, MPEG_AUDIO_PES_START_CODE,
call->Pts, 0);
iov[0].iov_len = InsertPesHeader(PesHeader, call->packet->size, MPEG_AUDIO_PES_START_CODE, call->Pts, 0);
iov[1].iov_base = call->packet->data;
iov[1].iov_len = call->packet->size;

View File

@@ -94,20 +94,8 @@ static int writeData(WriterAVCallData_t *call)
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
int len = 0;
h263_printf(10, "\n");
if (call == NULL) {
h263_err("call data is NULL...\n");
return 0;
}
h263_printf(10, "VideoPts %lld\n", call->Pts);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
h263_err("NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
h263_err("file pointer < 0. ignoring ...\n");
return 0;

View File

@@ -117,25 +117,13 @@ static int writeData(WriterAVCallData_t *call)
int len = 0;
int ic = 0;
struct iovec iov[128];
h264_printf(10, "\n");
if (call == NULL) {
h264_err("call data is NULL...\n");
return 0;
}
TimeDelta = 1000.0 * av_q2d(call->stream->r_frame_rate); /* rational to double */
TimeScale = (TimeDelta < 23970) ? 1001 : 1000; /* fixme: revise this */
VideoPts = call->Pts;
h264_printf(10, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta,
TimeScale);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
h264_err("NULL Data. ignoring...\n");
return 0;
}
h264_printf(10, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
if (call->fd < 0) {
h264_err("file pointer < 0. ignoring ...\n");

View File

@@ -93,13 +93,6 @@ static int writeData(WriterAVCallData_t *call)
{
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
mp3_printf(10, "\n");
if (call == NULL) {
mp3_err("call data is NULL...\n");
return 0;
}
mp3_printf(10, "AudioPts %lld\n", call->Pts);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {

View File

@@ -94,22 +94,10 @@ static int writeData(WriterAVCallData_t *call)
{
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
int len = 0;
unsigned int Position = 0;
mpeg2_printf(10, "\n");
if (call == NULL) {
mpeg2_err("call data is NULL...\n");
return 0;
}
int Position = 0;
mpeg2_printf(10, "VideoPts %lld\n", call->Pts);
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
mpeg2_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
mpeg2_err("file pointer < 0. ignoring ...\n");
return 0;

View File

@@ -187,20 +187,8 @@ static int writeData(WriterAVCallData_t *call)
{
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
pcm_printf(10, "\n");
if (!call) {
pcm_err("call data is NULL...\n");
return 0;
}
pcm_printf(10, "AudioPts %lld\n", call->Pts);
if (!call->packet->data || (call->packet->size <= 0)) {
pcm_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
pcm_err("file pointer < 0. ignoring ...\n");
return 0;

View File

@@ -125,18 +125,6 @@ static int writeData(WriterAVCallData_t *call)
{
int len = 0;
vc1_printf(10, "\n");
if (call == NULL) {
vc1_err("call data is NULL...\n");
return 0;
}
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
vc1_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->fd < 0) {
vc1_err("file pointer < 0. ignoring ...\n");
return 0;