Commit ca02d8ec authored by Diego Biurrun's avatar Diego Biurrun

Add '#undef fprintf' before PRINT macro that uses fprintf.

Otherwise there may be trouble when fprintf is disabled in favor of av_log.

Originally committed as revision 20515 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent e92ad83f
...@@ -3219,6 +3219,7 @@ int av_get_frame_filename(char *buf, int buf_size, ...@@ -3219,6 +3219,7 @@ int av_get_frame_filename(char *buf, int buf_size,
static void hex_dump_internal(void *avcl, FILE *f, int level, uint8_t *buf, int size) static void hex_dump_internal(void *avcl, FILE *f, int level, uint8_t *buf, int size)
{ {
int len, i, j, c; int len, i, j, c;
#undef fprintf
#define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) #define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0)
for(i=0;i<size;i+=16) { for(i=0;i<size;i+=16) {
...@@ -3257,6 +3258,7 @@ void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size) ...@@ -3257,6 +3258,7 @@ void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size)
//FIXME needs to know the time_base //FIXME needs to know the time_base
static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload) static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload)
{ {
#undef fprintf
#define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) #define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0)
PRINT("stream #%d:\n", pkt->stream_index); PRINT("stream #%d:\n", pkt->stream_index);
PRINT(" keyframe=%d\n", ((pkt->flags & PKT_FLAG_KEY) != 0)); PRINT(" keyframe=%d\n", ((pkt->flags & PKT_FLAG_KEY) != 0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment