From a254f89bcb34a626bea7ef1e15e3deafbc5ef306 Mon Sep 17 00:00:00 2001 From: max_10 Date: Sun, 24 Mar 2024 22:23:52 +0100 Subject: [PATCH] libeplayer3: add hal_debug Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/43c00c43faefe6ec759c5dde002f0d430f0051a5 Author: max_10 Date: 2024-03-24 (Sun, 24 Mar 2024) Origin message was: ------------------ - libeplayer3: add hal_debug ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- common/hal_debug.cpp | 8 + include/hal_debug.h | 9 +- libeplayer3/container/container.c | 8 +- libeplayer3/container/container_ffmpeg.c | 19 +- libeplayer3/external/flv2mpeg4/src/flv.h | 1 + libeplayer3/include/debug.h | 231 +++++++++++++++++++---- libeplayer3/manager/audio.c | 38 ++-- libeplayer3/manager/chapter.c | 56 +++--- libeplayer3/manager/subtitle.c | 36 ++-- libeplayer3/manager/video.c | 2 +- libeplayer3/output/output.c | 12 +- 11 files changed, 294 insertions(+), 126 deletions(-) diff --git a/common/hal_debug.cpp b/common/hal_debug.cpp index 1c8b183..f793e45 100644 --- a/common/hal_debug.cpp +++ b/common/hal_debug.cpp @@ -6,6 +6,7 @@ #include #include #include +#include "config.h" int cnxt_debug = 0; /* compat, unused */ @@ -22,9 +23,13 @@ static const char *hal_facility[] = "init ", "ca ", "record", + "player", NULL }; +#ifdef __cplusplus +extern "C" { +#endif void _hal_info(int facility, const void *func, const char *fmt, ...) { /* %p does print "(nil)" instead of 0x00000000 for NULL */ @@ -50,6 +55,9 @@ void _hal_debug(int facility, const void *func, const char *fmt, ...) vfprintf(stderr, fmt, args); va_end(args); } +#ifdef __cplusplus +} +#endif void hal_debug_init(void) { diff --git a/include/hal_debug.h b/include/hal_debug.h index 35bf876..2d48542 100644 --- a/include/hal_debug.h +++ b/include/hal_debug.h @@ -9,12 +9,19 @@ #define HAL_DEBUG_INIT 5 #define HAL_DEBUG_CA 6 #define HAL_DEBUG_RECORD 7 -#define HAL_DEBUG_ALL ((1<<8)-1) +#define HAL_DEBUG_PLAYER 8 +#define HAL_DEBUG_ALL ((1<<9)-1) extern int debuglevel; +#ifdef __cplusplus +extern "C" { +#endif void _hal_debug(int facility, const void *, const char *fmt, ...) __attribute__((format(printf, 3, 4))); void _hal_info(int facility, const void *, const char *fmt, ...) __attribute__((format(printf, 3, 4))); +#ifdef __cplusplus +} +#endif void hal_debug_init(void); void hal_set_threadname(const char *name); diff --git a/libeplayer3/container/container.c b/libeplayer3/container/container.c index a18790f..91acfd9 100644 --- a/libeplayer3/container/container.c +++ b/libeplayer3/container/container.c @@ -36,7 +36,7 @@ static void printContainerCapabilities() int32_t i = 0; int32_t j = 0; - container_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + container_printf(10, "\n"); container_printf(10, "Capabilities: "); for (i = 0; AvailableContainer[i] != NULL; i++) @@ -55,7 +55,7 @@ static int32_t selectContainer(Context_t *context, char *extension) int32_t j = 0; int32_t ret = -1; - container_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + container_printf(10, "\n"); for (i = 0; AvailableContainer[i] != NULL; i++) { @@ -89,7 +89,7 @@ static int Command(Context_t *context, ContainerCmd_t command, void *argument __ { int ret = 0; - container_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + container_printf(10, "\n"); switch (command) { @@ -109,7 +109,7 @@ static int Command(Context_t *context, ContainerCmd_t command, void *argument __ break; } default: - container_err("%s::%s ContainerCmd %d not supported!\n", __FILE__, __FUNCTION__, command); + container_err("ContainerCmd %d not supported!\n", command); break; } diff --git a/libeplayer3/container/container_ffmpeg.c b/libeplayer3/container/container_ffmpeg.c index 435b292..4a7c687 100644 --- a/libeplayer3/container/container_ffmpeg.c +++ b/libeplayer3/container/container_ffmpeg.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include #include -#include #include @@ -764,12 +764,6 @@ static void FFMPEGThread(Context_t *context) } } reset_finish_timeout(); - /* - if (bufferSize > 0) - { - context->output->Command(context, OUTPUT_CLEAR, NULL); - } - */ } else { @@ -1035,6 +1029,7 @@ static void FFMPEGThread(Context_t *context) pcmExtradata.bit_rate = get_codecpar(audioTrack->stream)->bit_rate; pcmExtradata.block_align = get_codecpar(audioTrack->stream)->block_align; pcmExtradata.frame_size = get_codecpar(audioTrack->stream)->frame_size; + pcmExtradata.codec_id = get_codecpar(audioTrack->stream)->codec_id; pcmExtradata.bResampling = restart_audio_resampling; @@ -1297,8 +1292,10 @@ static void FFMPEGThread(Context_t *context) avOut.width = 0; avOut.height = 0; avOut.type = "audio"; + pcmExtradata.private_data = pAudioExtradata; pcmExtradata.private_size = audioExtradataSize; + if (!context->playback->BackWard && Write(context->output->audio->Write, context, &avOut, pts) < 0) { ffmpeg_err("writing data to audio device failed\n"); @@ -1492,7 +1489,7 @@ int SAM_ReadFunc(void *ptr, uint8_t *buffer, int lSize) { ret = (int)fread((void *) buffer, (size_t) 1, (size_t) lSize, io->pFile); #if (LIBAVFORMAT_VERSION_MAJOR > 58) || ((LIBAVFORMAT_VERSION_MAJOR == 58) && (LIBAVFORMAT_VERSION_MINOR > 79)) - if(ret==0) + if (ret==0) ret = AVERROR_EOF; #endif } @@ -2492,11 +2489,13 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 if (off >= 0 && chan_config == 0) // channel config must be send in the inband PCE { track.aacbuf = malloc(AAC_HEADER_LENGTH + MAX_PCE_SIZE); + GetBitContext gb; PutBitContext pb; init_put_bits(&pb, track.aacbuf + AAC_HEADER_LENGTH, MAX_PCE_SIZE); init_get_bits8(&gb, get_codecpar(stream)->extradata, get_codecpar(stream)->extradata_size); skip_bits_long(&gb, off + 3); + put_bits(&pb, 3, 5); //ID_PCE track.aacbuflen = AAC_HEADER_LENGTH + (avpriv_copy_pce_data(&pb, &gb) + 3) / 8; flush_put_bits(&pb); @@ -2509,6 +2508,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 // https://wiki.multimedia.cx/index.php/ADTS object_type -= 1; //ADTS - profile, the MPEG-4 Audio Object Type minus 1 + track.aacbuf[0] = 0xFF; track.aacbuf[1] = 0xF1; //track.aacbuf[1] |=0x8; @@ -2537,6 +2537,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 get_codecpar(stream)->codec_id == AV_CODEC_ID_WMALOSSLESS) //if (get_codecpar(stream)->extradata_size > 0) { ffmpeg_printf(10, "Create WMA ExtraData\n"); + // type_specific_data uint16_t codec_id = 0; switch (get_codecpar(stream)->codec_id) @@ -2625,10 +2626,10 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 memcpy(track.aacbuf + 96, get_codecpar(stream)->extradata, get_codecpar(stream)->extradata_size); ffmpeg_printf(1, "aacbuf:\n"); + track.have_aacheader = 1; } #endif - if (context->manager->audio) { ffmpeg_printf(1, "cAVIdx[%d]: MANAGER_ADD track AUDIO\n", cAVIdx); diff --git a/libeplayer3/external/flv2mpeg4/src/flv.h b/libeplayer3/external/flv2mpeg4/src/flv.h index 573ceb5..3339cb4 100644 --- a/libeplayer3/external/flv2mpeg4/src/flv.h +++ b/libeplayer3/external/flv2mpeg4/src/flv.h @@ -87,6 +87,7 @@ void encode_I_mb(BW *bw, MICROBLOCK *mb, int escape_type); void encode_P_mb(BW *bw, MICROBLOCK *mb, int escape_type); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + static const uint16 rl_inter_vlc[103][2] = { { 0x2, 2 }, { 0xf, 4 }, { 0x15, 6 }, { 0x17, 7 }, diff --git a/libeplayer3/include/debug.h b/libeplayer3/include/debug.h index 89e7f56..20ff1d1 100644 --- a/libeplayer3/include/debug.h +++ b/libeplayer3/include/debug.h @@ -1,19 +1,34 @@ +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + #include #include +#include "hal_debug.h" + +#define hal_debug(args...) _hal_debug(HAL_DEBUG_PLAYER, NULL, args) +#define hal_info(args...) _hal_info(HAL_DEBUG_PLAYER, NULL, args) + #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) -#define log_error(fmt, x...) do { printf("[%s:%s] " fmt, __FILENAME__, __FUNCTION__, ## x); } while (0) -#define log_printf(maxlevel, level, fmt, x...) do { if (maxlevel >= level) printf("[%s:%s] " fmt, __FILENAME__, __FUNCTION__, ## x); } while (0) +#define log_error(fmt, x...) do { hal_info("[%s:%s] " fmt, __FILENAME__, __FUNCTION__, ## x); } while (0) +#define log_printf(maxlevel, level, fmt, x...) do { if (maxlevel >= level) hal_info("[%s:%s] " fmt, __FILENAME__, __FUNCTION__, ## x); } while (0) +#define log_debug(maxlevel, level, fmt, x...) do { if (maxlevel >= level) hal_debug("[%s:%s] " fmt, __FILENAME__, __FUNCTION__, ## x); } while (0) + +#define FFMPEG_DEBUG_ALL 10 /******************************************* * ffmpeg *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define FFMPEG_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define FFMPEG_DEBUG_LEVEL 0 +#endif #define FFMPEG_SILENT #if FFMPEG_DEBUG_LEVEL -#define ffmpeg_printf(...) log_printf(FFMPEG_DEBUG_LEVEL, __VA_ARGS__) +#define ffmpeg_printf(...) log_debug(FFMPEG_DEBUG_LEVEL, __VA_ARGS__) #else #define ffmpeg_printf(...) #endif @@ -27,11 +42,15 @@ /******************************************* * container *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define CONTAINER_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define CONTAINER_DEBUG_LEVEL 0 +#endif #define CONTAINER_SILENT #if CONTAINER_DEBUG_LEVEL -#define container_printf(...) log_printf(CONTAINER_DEBUG_LEVEL, __VA_ARGS__) +#define container_printf(...) log_debug(CONTAINER_DEBUG_LEVEL, __VA_ARGS__) #else #define container_printf(...) #endif @@ -45,11 +64,15 @@ /******************************************* * latmenc *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define LATMENC_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define LATMENC_DEBUG_LEVEL 0 +#endif #define LATMENC_SILENT #if LATMENC_DEBUG_LEVEL -#define latmenc_printf(...) log_printf(LATMENC_DEBUG_LEVEL, __VA_ARGS__) +#define latmenc_printf(...) log_debug(LATMENC_DEBUG_LEVEL, __VA_ARGS__) #else #define latmenc_printf(...) #endif @@ -63,11 +86,15 @@ /******************************************* * audio_mgr *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define AUDIO_MGR_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define AUDIO_MGR_DEBUG_LEVEL 0 +#endif #define AUDIO_MGR_SILENT #if AUDIO_MGR_DEBUG_LEVEL -#define audio_mgr_printf(...) log_printf(AUDIO_MGR_DEBUG_LEVEL, __VA_ARGS__) +#define audio_mgr_printf(...) log_debug(AUDIO_MGR_DEBUG_LEVEL, __VA_ARGS__) #else #define audio_mgr_printf(...) #endif @@ -78,14 +105,40 @@ #define audio_mgr_err(...) #endif +/******************************************* + * chapter_mgr + *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define CHAPTER_MGR_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else +#define CHAPTER_MGR_DEBUG_LEVEL 0 +#endif +#define CHAPTER_MGR_SILENT + +#if CHAPTER_MGR_DEBUG_LEVEL +#define chapter_mgr_printf(...) log_debug(CHAPTER_MGR_DEBUG_LEVEL, __VA_ARGS__) +#else +#define chapter_mgr_printf(...) +#endif + +#ifndef CHAPTER_MGR_SILENT +#define chapter_mgr_err(...) log_error(__VA_ARGS__) +#else +#define chapter_mgr_err(...) +#endif + /******************************************* * subtitle_mgr *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define SUBTITLE_MGR_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define SUBTITLE_MGR_DEBUG_LEVEL 0 +#endif #define SUBTITLE_MGR_SILENT #if SUBTITLE_MGR_DEBUG_LEVEL -#define subtitle_mgr_printf(...) log_printf(SUBTITLE_MGR_DEBUG_LEVEL, __VA_ARGS__) +#define subtitle_mgr_printf(...) log_debug(SUBTITLE_MGR_DEBUG_LEVEL, __VA_ARGS__) #else #define subtitle_mgr_printf(...) #endif @@ -99,11 +152,15 @@ /******************************************* * video_mgr *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define VIDEO_MGR_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define VIDEO_MGR_DEBUG_LEVEL 0 +#endif #define VIDEO_MGR_SILENT #if VIDEO_MGR_DEBUG_LEVEL -#define video_mgr_printf(...) log_printf(VIDEO_MGR_DEBUG_LEVEL, __VA_ARGS__) +#define video_mgr_printf(...) log_debug(VIDEO_MGR_DEBUG_LEVEL, __VA_ARGS__) #else #define video_mgr_printf(...) #endif @@ -117,11 +174,15 @@ /******************************************* * linuxdvb *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define LINUXDVB_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define LINUXDVB_DEBUG_LEVEL 0 +#endif #define LINUXDVB_SILENT #if LINUXDVB_DEBUG_LEVEL -#define linuxdvb_printf(...) log_printf(LINUXDVB_DEBUG_LEVEL, __VA_ARGS__) +#define linuxdvb_printf(...) log_debug(LINUXDVB_DEBUG_LEVEL, __VA_ARGS__) #else #define linuxdvb_printf(...) #endif @@ -135,11 +196,15 @@ /******************************************* * buff *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define BUFF_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define BUFF_DEBUG_LEVEL 0 +#endif #define BUFF_SILENT #if BUFF_DEBUG_LEVEL -#define buff_printf(...) log_printf(BUFF_DEBUG_LEVEL, __VA_ARGS__) +#define buff_printf(...) log_debug(BUFF_DEBUG_LEVEL, __VA_ARGS__) #else #define buff_printf(...) #endif @@ -153,11 +218,15 @@ /******************************************* * output *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define OUTPUT_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define OUTPUT_DEBUG_LEVEL 0 +#endif #define OUTPUT_SILENT #if OUTPUT_DEBUG_LEVEL -#define output_printf(...) log_printf(OUTPUT_DEBUG_LEVEL, __VA_ARGS__) +#define output_printf(...) log_debug(OUTPUT_DEBUG_LEVEL, __VA_ARGS__) #else #define output_printf(...) #endif @@ -171,11 +240,15 @@ /******************************************* * subtitle *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define SUBTITLE_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define SUBTITLE_DEBUG_LEVEL 0 +#endif #define SUBTITLE_SILENT #if SUBTITLE_DEBUG_LEVEL -#define subtitle_printf(...) log_printf(SUBTITLE_DEBUG_LEVEL, __VA_ARGS__) +#define subtitle_printf(...) log_debug(SUBTITLE_DEBUG_LEVEL, __VA_ARGS__) #else #define subtitle_printf(...) #endif @@ -189,11 +262,15 @@ /******************************************* * writer *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define WRITER_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define WRITER_DEBUG_LEVEL 0 +#endif #define WRITER_SILENT #if WRITER_DEBUG_LEVEL -#define writer_printf(...) log_printf(WRITER_DEBUG_LEVEL, __VA_ARGS__) +#define writer_printf(...) log_debug(WRITER_DEBUG_LEVEL, __VA_ARGS__) #else #define writer_printf(...) #endif @@ -207,11 +284,15 @@ /******************************************* * playback *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define PLAYBACK_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define PLAYBACK_DEBUG_LEVEL 0 +#endif #define PLAYBACK_SILENT #if PLAYBACK_DEBUG_LEVEL -#define playback_printf(...) log_printf(PLAYBACK_DEBUG_LEVEL, __VA_ARGS__) +#define playback_printf(...) log_debug(PLAYBACK_DEBUG_LEVEL, __VA_ARGS__) #else #define playback_printf(...) #endif @@ -225,11 +306,15 @@ /******************************************* * aac *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define AAC_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define AAC_DEBUG_LEVEL 0 +#endif #define AAC_SILENT #if AAC_DEBUG_LEVEL -#define aac_printf(...) log_printf(AAC_DEBUG_LEVEL, __VA_ARGS__) +#define aac_printf(...) log_debug(AAC_DEBUG_LEVEL, __VA_ARGS__) #else #define aac_printf(...) #endif @@ -243,11 +328,15 @@ /******************************************* * ac3 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define AC3_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define AC3_DEBUG_LEVEL 0 +#endif #define AC3_SILENT #if AC3_DEBUG_LEVEL -#define ac3_printf(...) log_printf(AC3_DEBUG_LEVEL, __VA_ARGS__) +#define ac3_printf(...) log_debug(AC3_DEBUG_LEVEL, __VA_ARGS__) #else #define ac3_printf(...) #endif @@ -261,11 +350,15 @@ /******************************************* * amr *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define AMR_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define AMR_DEBUG_LEVEL 0 +#endif #define AMR_SILENT #if AMR_DEBUG_LEVEL -#define amr_printf(...) log_printf(AMR_DEBUG_LEVEL, __VA_ARGS__) +#define amr_printf(...) log_debug(AMR_DEBUG_LEVEL, __VA_ARGS__) #else #define amr_printf(...) #endif @@ -279,11 +372,15 @@ /******************************************* * divx *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define DIVX_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define DIVX_DEBUG_LEVEL 0 +#endif #define DIVX_SILENT #if DIVX_DEBUG_LEVEL -#define divx_printf(...) log_printf(DIVX_DEBUG_LEVEL, __VA_ARGS__) +#define divx_printf(...) log_debug(DIVX_DEBUG_LEVEL, __VA_ARGS__) #else #define divx_printf(...) #endif @@ -297,11 +394,15 @@ /******************************************* * dts *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define DTS_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define DTS_DEBUG_LEVEL 0 +#endif #define DTS_SILENT #if DTS_DEBUG_LEVEL -#define dts_printf(...) log_printf(DTS_DEBUG_LEVEL, __VA_ARGS__) +#define dts_printf(...) log_debug(DTS_DEBUG_LEVEL, __VA_ARGS__) #else #define dts_printf(...) #endif @@ -315,11 +416,15 @@ /******************************************* * h263 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define H263_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define H263_DEBUG_LEVEL 0 +#endif #define H263_SILENT #if H263_DEBUG_LEVEL -#define h263_printf(...) log_printf(H263_DEBUG_LEVEL, __VA_ARGS__) +#define h263_printf(...) log_debug(H263_DEBUG_LEVEL, __VA_ARGS__) #else #define h263_printf(...) #endif @@ -333,11 +438,15 @@ /******************************************* * h264 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define H264_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define H264_DEBUG_LEVEL 0 +#endif #define H264_SILENT #if H264_DEBUG_LEVEL -#define h264_printf(...) log_printf(H264_DEBUG_LEVEL, __VA_ARGS__) +#define h264_printf(...) log_debug(H264_DEBUG_LEVEL, __VA_ARGS__) #else #define h264_printf(...) #endif @@ -351,11 +460,15 @@ /******************************************* * h265 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define H265_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define H265_DEBUG_LEVEL 0 +#endif #define H265_SILENT #if H265_DEBUG_LEVEL -#define h265_printf(...) log_printf(H265_DEBUG_LEVEL, __VA_ARGS__) +#define h265_printf(...) log_debug(H265_DEBUG_LEVEL, __VA_ARGS__) #else #define h265_printf(...) #endif @@ -369,11 +482,15 @@ /******************************************* * lpcm *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define LPCM_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define LPCM_DEBUG_LEVEL 0 +#endif #define LPCM_SILENT #if LPCM_DEBUG_LEVEL -#define lpcm_printf(...) log_printf(LPCM_DEBUG_LEVEL, __VA_ARGS__) +#define lpcm_printf(...) log_debug(LPCM_DEBUG_LEVEL, __VA_ARGS__) #else #define lpcm_printf(...) #endif @@ -387,11 +504,15 @@ /******************************************* * mp3 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define MP3_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define MP3_DEBUG_LEVEL 0 +#endif #define MP3_SILENT #if MP3_DEBUG_LEVEL -#define mp3_printf(...) log_printf(MP3_DEBUG_LEVEL, __VA_ARGS__) +#define mp3_printf(...) log_debug(MP3_DEBUG_LEVEL, __VA_ARGS__) #else #define mp3_printf(...) #endif @@ -405,11 +526,15 @@ /******************************************* * mpeg2 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define MPEG2_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define MPEG2_DEBUG_LEVEL 0 +#endif #define MPEG2_SILENT #if MPEG2_DEBUG_LEVEL -#define mpeg2_printf(...) log_printf(MPEG2_DEBUG_LEVEL, __VA_ARGS__) +#define mpeg2_printf(...) log_debug(MPEG2_DEBUG_LEVEL, __VA_ARGS__) #else #define mpeg2_printf(...) #endif @@ -423,11 +548,15 @@ /******************************************* * mpeg4 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define MPEG4_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define MPEG4_DEBUG_LEVEL 0 +#endif #define MPEG4_SILENT #if MPEG4_DEBUG_LEVEL -#define mpeg4_printf(...) log_printf(MPEG4_DEBUG_LEVEL, __VA_ARGS__) +#define mpeg4_printf(...) log_debug(MPEG4_DEBUG_LEVEL, __VA_ARGS__) #else #define mpeg4_printf(...) #endif @@ -441,11 +570,15 @@ /******************************************* * pcm *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define PCM_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define PCM_DEBUG_LEVEL 0 +#endif #define PCM_SILENT #if PCM_DEBUG_LEVEL -#define pcm_printf(...) log_printf(PCM_DEBUG_LEVEL, __VA_ARGS__) +#define pcm_printf(...) log_debug(PCM_DEBUG_LEVEL, __VA_ARGS__) #else #define pcm_printf(...) #endif @@ -459,11 +592,15 @@ /******************************************* * vc1 *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define VC1_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define VC1_DEBUG_LEVEL 0 +#endif #define VC1_SILENT #if VC1_DEBUG_LEVEL -#define vc1_printf(...) log_printf(VC1_DEBUG_LEVEL, __VA_ARGS__) +#define vc1_printf(...) log_debug(VC1_DEBUG_LEVEL, __VA_ARGS__) #else #define vc1_printf(...) #endif @@ -477,11 +614,15 @@ /******************************************* * vp *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define VP_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define VP_DEBUG_LEVEL 0 +#endif #define VP_SILENT #if VP_DEBUG_LEVEL -#define vp_printf(...) log_printf(VP_DEBUG_LEVEL, __VA_ARGS__) +#define vp_printf(...) log_debug(VP_DEBUG_LEVEL, __VA_ARGS__) #else #define vp_printf(...) #endif @@ -495,11 +636,15 @@ /******************************************* * wma *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define WMA_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define WMA_DEBUG_LEVEL 0 +#endif #define WMA_SILENT #if WMA_DEBUG_LEVEL -#define wma_printf(...) log_printf(WMA_DEBUG_LEVEL, __VA_ARGS__) +#define wma_printf(...) log_debug(WMA_DEBUG_LEVEL, __VA_ARGS__) #else #define wma_printf(...) #endif @@ -513,11 +658,15 @@ /******************************************* * wmv *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define WMV_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define WMV_DEBUG_LEVEL 0 +#endif #define WMV_SILENT #if WMV_DEBUG_LEVEL -#define wmv_printf(...) log_printf(WMV_DEBUG_LEVEL, __VA_ARGS__) +#define wmv_printf(...) log_debug(WMV_DEBUG_LEVEL, __VA_ARGS__) #else #define wmv_printf(...) #endif @@ -531,11 +680,15 @@ /******************************************* * mjpeg *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define MJPEG_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define MJPEG_DEBUG_LEVEL 0 +#endif #define MJPEG_SILENT #if MJPEG_DEBUG_LEVEL -#define mjpeg_printf(...) log_printf(MJPEG_DEBUG_LEVEL, __VA_ARGS__) +#define mjpeg_printf(...) log_debug(MJPEG_DEBUG_LEVEL, __VA_ARGS__) #else #define mjpeg_printf(...) #endif @@ -549,11 +702,15 @@ /******************************************* * bcma *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define BCMA_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define BCMA_DEBUG_LEVEL 0 +#endif #define BCMA_SILENT #if BCMA_DEBUG_LEVEL -#define bcma_printf(...) log_printf(BCMA_DEBUG_LEVEL, __VA_ARGS__) +#define bcma_printf(...) log_debug(BCMA_DEBUG_LEVEL, __VA_ARGS__) #else #define bcma_printf(...) #endif @@ -567,11 +724,15 @@ /******************************************* * plugin *******************************************/ +#if FFMPEG_DEBUG_ALL > 0 +#define PLUGIN_DEBUG_LEVEL FFMPEG_DEBUG_ALL +#else #define PLUGIN_DEBUG_LEVEL 0 +#endif #define PLUGIN_SILENT #if PLUGIN_DEBUG_LEVEL -#define plugin_printf(...) log_printf(PLUGIN_DEBUG_LEVEL, __VA_ARGS__) +#define plugin_printf(...) log_debug(PLUGIN_DEBUG_LEVEL, __VA_ARGS__) #else #define plugin_printf(...) #endif @@ -581,3 +742,5 @@ #else #define plugin_err(...) #endif + +#endif diff --git a/libeplayer3/manager/audio.c b/libeplayer3/manager/audio.c index ad2a376..d8c2e91 100644 --- a/libeplayer3/manager/audio.c +++ b/libeplayer3/manager/audio.c @@ -61,7 +61,7 @@ static int CurrentTrack = 0; //TRACK[0] as default. static int ManagerAdd(Context_t *context, Track_t track) { - audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", __FILE__, __FUNCTION__, track.Name, track.Encoding, track.Id); + audio_mgr_printf(10, "name=\"%s\" encoding=\"%s\" id=%d\n", track.Name, track.Encoding, track.Id); if (Tracks == NULL) { @@ -75,7 +75,7 @@ static int ManagerAdd(Context_t *context, Track_t track) if (Tracks == NULL) { - audio_mgr_err("%s::%s malloc failed\n", __FILE__, __FUNCTION__); + audio_mgr_err("malloc failed\n"); return cERR_AUDIO_MGR_ERROR; } @@ -101,7 +101,7 @@ static int ManagerAdd(Context_t *context, Track_t track) } else { - audio_mgr_err("%s::%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP); + audio_mgr_err("TrackCount out if range %d - %d\n", TrackCount, TRACKWRAP); return cERR_AUDIO_MGR_ERROR; } @@ -110,7 +110,7 @@ static int ManagerAdd(Context_t *context, Track_t track) context->playback->isAudio = 1; } - audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + audio_mgr_printf(10, "\n"); return cERR_AUDIO_MGR_NO_ERROR; } @@ -120,7 +120,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) int i = 0, j = 0; char **tracklist = NULL; - audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + audio_mgr_printf(10, "\n"); if (Tracks != NULL) { @@ -128,7 +128,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) if (tracklist == NULL) { - audio_mgr_err("%s::%s malloc failed\n", __FILE__, __FUNCTION__); + audio_mgr_err("malloc failed\n"); return NULL; } @@ -148,7 +148,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) tracklist[j] = NULL; } - audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount); + audio_mgr_printf(10, "return %p (%d - %d)\n", tracklist, j, TrackCount); return tracklist; } @@ -157,7 +157,7 @@ static int ManagerDel(Context_t *context) { int i = 0; - audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + audio_mgr_printf(10, "\n"); if (Tracks != NULL) { @@ -171,7 +171,7 @@ static int ManagerDel(Context_t *context) } else { - audio_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__); + audio_mgr_err("nothing to delete!\n"); return cERR_AUDIO_MGR_ERROR; } @@ -179,7 +179,7 @@ static int ManagerDel(Context_t *context) CurrentTrack = 0; context->playback->isAudio = 0; - audio_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__); + audio_mgr_printf(10, "return no error\n"); return cERR_AUDIO_MGR_NO_ERROR; } @@ -188,7 +188,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { int ret = cERR_AUDIO_MGR_NO_ERROR; - audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + audio_mgr_printf(10, "\n"); switch (command) { @@ -217,7 +217,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) } case MANAGER_GET: { - audio_mgr_printf(20, "%s::%s MANAGER_GET\n", __FILE__, __FUNCTION__); + audio_mgr_printf(20, "MANAGER_GET\n"); if ((TrackCount > 0) && (CurrentTrack >= 0)) { @@ -251,7 +251,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) } case MANAGER_GET_TRACK: { - audio_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__); + audio_mgr_printf(20, "MANAGER_GET_TRACK\n"); if ((TrackCount > 0) && (CurrentTrack >= 0)) { @@ -265,7 +265,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) } case MANAGER_GETENCODING: { - if ((TrackCount > 0) && (CurrentTrack >= 0) && (Tracks[CurrentTrack].Encoding != NULL)) + if ((TrackCount > 0) && (CurrentTrack >= 0)) { *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Encoding); } @@ -277,7 +277,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) } case MANAGER_GETNAME: { - if ((TrackCount > 0) && (CurrentTrack >= 0) && (Tracks[CurrentTrack].Name != NULL)) + if ((TrackCount > 0) && (CurrentTrack >= 0)) { *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Name); } @@ -290,7 +290,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) case MANAGER_SET: { int i; - audio_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", __FILE__, __FUNCTION__, *((int *)argument)); + audio_mgr_printf(20, "MANAGER_SET id=%d\n", *((int *)argument)); for (i = 0; i < TrackCount; i++) { @@ -303,7 +303,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) if (i == TrackCount) { - audio_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument)); + audio_mgr_err("track id %d unknown\n", *((int *)argument)); ret = cERR_AUDIO_MGR_ERROR; } break; @@ -323,12 +323,12 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) break; } default: - audio_mgr_err("%s::%s ContainerCmd %d not supported!\n", __FILE__, __FUNCTION__, command); + audio_mgr_err("ContainerCmd %d not supported!\n", command); ret = cERR_AUDIO_MGR_ERROR; break; } - audio_mgr_printf(10, "%s::%s returning %d\n", __FILE__, __FUNCTION__, ret); + audio_mgr_printf(10, "returning %d\n", ret); return ret; } diff --git a/libeplayer3/manager/chapter.c b/libeplayer3/manager/chapter.c index 3dc181d..4c64f91 100644 --- a/libeplayer3/manager/chapter.c +++ b/libeplayer3/manager/chapter.c @@ -26,36 +26,18 @@ #include "manager.h" #include "common.h" +#include "debug.h" /* ***************************** */ /* Makros/Constants */ /* ***************************** */ -#define TRACKWRAP 64 -#define CHAPTER_MGR_DEBUG - -#ifdef CHAPTER_MGR_DEBUG - -static short debug_level = 0; - -#define chapter_mgr_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) -#else -#define chapter_mgr_printf(level, x...) -#endif - -#ifndef CHAPTER_MGR_SILENT -#define chapter_mgr_err(x...) do { printf(x); } while (0) -#else -#define chapter_mgr_err(x...) -#endif +#define TRACKWRAP 20 /* Error Constants */ #define cERR_CHAPTER_MGR_NO_ERROR 0 #define cERR_CHAPTER_MGR_ERROR -1 -static const char FILENAME[] = __FILE__; - /* ***************************** */ /* Types */ /* ***************************** */ @@ -78,19 +60,21 @@ static int CurrentTrack = 0; //TRACK[0] as default. static int ManagerAdd(Context_t *context __attribute__((unused)), Track_t track) { - chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + chapter_mgr_printf(10, "name=\"%s\" encoding=\"%s\" id=%d\n", track.Name, track.Encoding, track.Id); if (Tracks == NULL) { Tracks = malloc(sizeof(Track_t) * TRACKWRAP); int i; for (i = 0; i < TRACKWRAP; i++) + { Tracks[i].Id = -1; + } } if (Tracks == NULL) { - chapter_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + chapter_mgr_err("malloc failed\n"); return cERR_CHAPTER_MGR_ERROR; } @@ -112,11 +96,11 @@ static int ManagerAdd(Context_t *context __attribute__((unused)), Track_t track) } else { - chapter_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, TrackCount, TRACKWRAP); + chapter_mgr_err("TrackCount out if range %d - %d\n", TrackCount, TRACKWRAP); return cERR_CHAPTER_MGR_ERROR; } - chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + chapter_mgr_printf(10, "\n"); return cERR_CHAPTER_MGR_NO_ERROR; } @@ -126,23 +110,25 @@ static char **ManagerList(Context_t *context __attribute__((unused))) int i = 0, j = 0; char **tracklist = NULL; - chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + chapter_mgr_printf(10, "\n"); if (Tracks != NULL) { - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); if (tracklist == NULL) { - chapter_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + chapter_mgr_err("malloc failed\n"); return NULL; } for (i = 0, j = 0; i < TrackCount; i++, j += 2) { if (Tracks[i].pending) + { continue; + } + char tmp[20]; snprintf(tmp, sizeof(tmp), "%d", (int)Tracks[i].chapter_start); tracklist[j] = strdup(tmp); @@ -151,7 +137,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) tracklist[j] = NULL; } - chapter_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); + chapter_mgr_printf(10, "return %p (%d - %d)\n", tracklist, j, TrackCount); return tracklist; } @@ -160,7 +146,7 @@ static int ManagerDel(Context_t *context __attribute__((unused))) { int i = 0; - chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + chapter_mgr_printf(10, "\n"); if (Tracks != NULL) { @@ -173,14 +159,14 @@ static int ManagerDel(Context_t *context __attribute__((unused))) } else { - chapter_mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__); + chapter_mgr_err("nothing to delete!\n"); return cERR_CHAPTER_MGR_ERROR; } TrackCount = 0; CurrentTrack = 0; - chapter_mgr_printf(10, "%s::%s return no error\n", FILENAME, __FUNCTION__); + chapter_mgr_printf(10, "return no error\n"); return cERR_CHAPTER_MGR_NO_ERROR; } @@ -189,7 +175,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { int ret = cERR_CHAPTER_MGR_NO_ERROR; - chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + chapter_mgr_printf(10, "\n"); switch (command) { @@ -214,16 +200,18 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { int i; for (i = 0; i < TrackCount; i++) + { Tracks[i].pending = 1; + } break; } default: - chapter_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); + chapter_mgr_err("ContainerCmd %d not supported!\n", command); ret = cERR_CHAPTER_MGR_ERROR; break; } - chapter_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret); + chapter_mgr_printf(10, "returning %d\n", ret); return ret; } diff --git a/libeplayer3/manager/subtitle.c b/libeplayer3/manager/subtitle.c index 1e26e30..0aa609d 100644 --- a/libeplayer3/manager/subtitle.c +++ b/libeplayer3/manager/subtitle.c @@ -60,7 +60,7 @@ static int CurrentTrack = -1; //no as default. static int ManagerAdd(Context_t *context __attribute__((unused)), Track_t track) { - subtitle_mgr_printf(10, "%s::%s %s %s %d\n", __FILE__, __FUNCTION__, track.Name, track.Encoding, track.Id); + subtitle_mgr_printf(10, "%s %s %d\n", track.Name, track.Encoding, track.Id); if (Tracks == NULL) { @@ -74,7 +74,7 @@ static int ManagerAdd(Context_t *context __attribute__((unused)), Track_t track) if (Tracks == NULL) { - subtitle_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); + subtitle_mgr_err("malloc failed\n"); return cERR_SUBTITLE_MGR_ERROR; } @@ -95,16 +95,16 @@ static int ManagerAdd(Context_t *context __attribute__((unused)), Track_t track) } else { - subtitle_mgr_err("%s::%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP); + subtitle_mgr_err("TrackCount out if range %d - %d\n", TrackCount, TRACKWRAP); return cERR_SUBTITLE_MGR_ERROR; } if (TrackCount > 0) { -// context->playback->isSubtitle = 1; + context->playback->isSubtitle = 1; } - subtitle_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + subtitle_mgr_printf(10, "\n"); return cERR_SUBTITLE_MGR_NO_ERROR; } @@ -114,7 +114,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) int i = 0, j = 0; char **tracklist = NULL; - subtitle_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + subtitle_mgr_printf(10, "\n"); if (Tracks != NULL) { @@ -122,7 +122,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) if (tracklist == NULL) { - subtitle_mgr_err("%s::%s malloc failed\n", __FILE__, __FUNCTION__); + subtitle_mgr_err("malloc failed\n"); return NULL; } @@ -142,7 +142,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) tracklist[j] = NULL; } - subtitle_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount); + subtitle_mgr_printf(10, "return %p (%d - %d)\n", tracklist, j, TrackCount); return tracklist; } @@ -151,7 +151,7 @@ static int ManagerDel(Context_t *context __attribute__((unused))) { int i = 0; - subtitle_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + subtitle_mgr_printf(10, "\n"); if (Tracks != NULL) { @@ -165,7 +165,7 @@ static int ManagerDel(Context_t *context __attribute__((unused))) } else { - subtitle_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__); + subtitle_mgr_err("nothing to delete!\n"); return cERR_SUBTITLE_MGR_ERROR; } @@ -173,7 +173,7 @@ static int ManagerDel(Context_t *context __attribute__((unused))) CurrentTrack = -1; // context->playback->isSubtitle = 0; - subtitle_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__); + subtitle_mgr_printf(10, "return no error\n"); return cERR_SUBTITLE_MGR_NO_ERROR; } @@ -182,7 +182,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { int ret = cERR_SUBTITLE_MGR_NO_ERROR; - subtitle_mgr_printf(50, "%s::%s %d\n", __FILE__, __FUNCTION__, command); + subtitle_mgr_printf(50, "%d\n", command); switch (command) { @@ -200,7 +200,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) } case MANAGER_GET: { - subtitle_mgr_printf(20, "%s::%s MANAGER_GET\n", FILENAME, __FUNCTION__); + subtitle_mgr_printf(20, "MANAGER_GET\n"); if (TrackCount > 0 && CurrentTrack >= 0) { @@ -234,7 +234,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) } case MANAGER_GET_TRACK: { - subtitle_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); + subtitle_mgr_printf(20, "MANAGER_GET_TRACK\n"); if ((TrackCount > 0) && (CurrentTrack >= 0)) { @@ -274,7 +274,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { int i; - subtitle_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", __FILE__, __FUNCTION__, *((int *)argument)); + subtitle_mgr_printf(20, "MANAGER_SET id=%d\n", *((int *)argument)); if (*((int *)argument) < 0) { @@ -293,7 +293,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) if (i == TrackCount) { - subtitle_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument)); + subtitle_mgr_err("track id %d unknown\n", *((int *)argument)); ret = cERR_SUBTITLE_MGR_ERROR; } break; @@ -313,12 +313,12 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) break; } default: - subtitle_mgr_err("%s::%s ContainerCmd not supported!", __FILE__, __FUNCTION__); + subtitle_mgr_err("ContainerCmd not supported!"); ret = cERR_SUBTITLE_MGR_ERROR; break; } - subtitle_mgr_printf(50, "%s::%s returning %d\n", __FILE__, __FUNCTION__, ret); + subtitle_mgr_printf(50, "returning %d\n", ret); return ret; } diff --git a/libeplayer3/manager/video.c b/libeplayer3/manager/video.c index 5bbf2ff..40deec5 100644 --- a/libeplayer3/manager/video.c +++ b/libeplayer3/manager/video.c @@ -144,7 +144,7 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused) tracklist[j].Id = -1; } - video_mgr_printf(10, "return %p (%d - %d)\n", tracklist, j, TrackCount); + video_mgr_printf(10, "return %p %d\n", tracklist, TrackCount); return tracklist; } diff --git a/libeplayer3/output/output.c b/libeplayer3/output/output.c index 89ebd5b..51374a0 100644 --- a/libeplayer3/output/output.c +++ b/libeplayer3/output/output.c @@ -63,7 +63,7 @@ static void printOutputCapabilities() { int i, j; - output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + output_printf(10, "\n"); output_printf(10, "Capabilities:\n"); for (i = 0; AvailableOutput[i] != NULL; i++) @@ -86,7 +86,7 @@ static void OutputAdd(Context_t *context, char *port) { int i, j; - output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + output_printf(10, "\n"); for (i = 0; AvailableOutput[i] != NULL; i++) { @@ -116,7 +116,7 @@ static void OutputAdd(Context_t *context, char *port) static void OutputDel(Context_t *context, char *port) { - output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + output_printf(10, "\n"); if (!strcmp("audio", port)) { @@ -136,7 +136,7 @@ static int Command(Context_t *context, OutputCmd_t command, void *argument) { int ret = cERR_OUTPUT_NO_ERROR; - output_printf(10, "%s::%s Command %d\n", __FILE__, __FUNCTION__, command); + output_printf(10, "Command %d\n", command); switch (command) { @@ -584,12 +584,12 @@ static int Command(Context_t *context, OutputCmd_t command, void *argument) break; } default: - output_err("%s::%s OutputCmd %d not supported!\n", __FILE__, __FUNCTION__, command); + output_err("OutputCmd %d not supported!\n", command); ret = cERR_OUTPUT_INTERNAL_ERROR; break; } - output_printf(10, "%s::%s exiting with value %d\n", __FILE__, __FUNCTION__, ret); + output_printf(10, "exiting with value %d\n", ret); return ret; }