From 9f9d1b64cecb70dc137ffbd198b4e8054a6025e8 Mon Sep 17 00:00:00 2001 From: martii Date: Sat, 5 Apr 2014 16:40:03 +0200 Subject: [PATCH] libeplayer: cleanup writers --- libeplayer3/output/writer/ac3.cpp | 10 ---------- libeplayer3/output/writer/divx.cpp | 10 ---------- libeplayer3/output/writer/dts.cpp | 12 ------------ libeplayer3/output/writer/flac.cpp | 11 +---------- libeplayer3/output/writer/h263.cpp | 12 ------------ libeplayer3/output/writer/h264.cpp | 14 +------------- libeplayer3/output/writer/mp3.cpp | 7 ------- libeplayer3/output/writer/mpeg2.cpp | 14 +------------- libeplayer3/output/writer/pcm.cpp | 12 ------------ libeplayer3/output/writer/vc1.cpp | 12 ------------ 10 files changed, 3 insertions(+), 111 deletions(-) diff --git a/libeplayer3/output/writer/ac3.cpp b/libeplayer3/output/writer/ac3.cpp index dcda562..b4547ff 100644 --- a/libeplayer3/output/writer/ac3.cpp +++ b/libeplayer3/output/writer/ac3.cpp @@ -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; diff --git a/libeplayer3/output/writer/divx.cpp b/libeplayer3/output/writer/divx.cpp index b536c22..568f161 100644 --- a/libeplayer3/output/writer/divx.cpp +++ b/libeplayer3/output/writer/divx.cpp @@ -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; diff --git a/libeplayer3/output/writer/dts.cpp b/libeplayer3/output/writer/dts.cpp index f63b33f..787c048 100644 --- a/libeplayer3/output/writer/dts.cpp +++ b/libeplayer3/output/writer/dts.cpp @@ -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; diff --git a/libeplayer3/output/writer/flac.cpp b/libeplayer3/output/writer/flac.cpp index 0841914..b958dca 100644 --- a/libeplayer3/output/writer/flac.cpp +++ b/libeplayer3/output/writer/flac.cpp @@ -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; diff --git a/libeplayer3/output/writer/h263.cpp b/libeplayer3/output/writer/h263.cpp index 41bc366..d7d2fb4 100644 --- a/libeplayer3/output/writer/h263.cpp +++ b/libeplayer3/output/writer/h263.cpp @@ -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; diff --git a/libeplayer3/output/writer/h264.cpp b/libeplayer3/output/writer/h264.cpp index 9a1304c..61ebc1e 100644 --- a/libeplayer3/output/writer/h264.cpp +++ b/libeplayer3/output/writer/h264.cpp @@ -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"); diff --git a/libeplayer3/output/writer/mp3.cpp b/libeplayer3/output/writer/mp3.cpp index 1b6d849..6906c31 100644 --- a/libeplayer3/output/writer/mp3.cpp +++ b/libeplayer3/output/writer/mp3.cpp @@ -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)) { diff --git a/libeplayer3/output/writer/mpeg2.cpp b/libeplayer3/output/writer/mpeg2.cpp index a825231..9869ba1 100644 --- a/libeplayer3/output/writer/mpeg2.cpp +++ b/libeplayer3/output/writer/mpeg2.cpp @@ -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; diff --git a/libeplayer3/output/writer/pcm.cpp b/libeplayer3/output/writer/pcm.cpp index f1014c0..c6bd8d8 100644 --- a/libeplayer3/output/writer/pcm.cpp +++ b/libeplayer3/output/writer/pcm.cpp @@ -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; diff --git a/libeplayer3/output/writer/vc1.cpp b/libeplayer3/output/writer/vc1.cpp index e08c157..a79e740 100644 --- a/libeplayer3/output/writer/vc1.cpp +++ b/libeplayer3/output/writer/vc1.cpp @@ -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;