On 2014-01-16 03:55:45 +0100, Diego Biurrun wrote: > --- > libavformat/utils.c | 18 +++++------------- > 1 file changed, 5 insertions(+), 13 deletions(-) > > diff --git a/libavformat/utils.c b/libavformat/utils.c > index 4fee6ec..74d1e69 100644 > --- a/libavformat/utils.c > +++ b/libavformat/utils.c > @@ -3006,10 +3006,6 @@ fail: > return -1; > } > > -static void hex_dump_internal(void *avcl, FILE *f, int level, > - const uint8_t *buf, int size) > -{ > - int len, i, j, c; > #define PRINT(...) \ > do { \ > if (!f) \ > @@ -3018,6 +3014,11 @@ static void hex_dump_internal(void *avcl, FILE *f, int > level, > fprintf(f, __VA_ARGS__); \ > } while (0) > > +static void hex_dump_internal(void *avcl, FILE *f, int level, > + const uint8_t *buf, int size) > +{ > + int len, i, j, c; > + > for (i = 0; i < size; i += 16) { > len = size - i; > if (len > 16) > @@ -3038,7 +3039,6 @@ static void hex_dump_internal(void *avcl, FILE *f, int > level, > } > PRINT("\n"); > } > -#undef PRINT > } > > void av_hex_dump(FILE *f, const uint8_t *buf, int size) > @@ -3054,13 +3054,6 @@ void av_hex_dump_log(void *avcl, int level, const > uint8_t *buf, int size) > static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, > int dump_payload, AVRational time_base) > { > -#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(" keyframe=%d\n", ((pkt->flags & AV_PKT_FLAG_KEY) != 0)); > PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base)); > @@ -3078,7 +3071,6 @@ static void pkt_dump_internal(void *avcl, FILE *f, int > level, AVPacket *pkt, > PRINT("%0.3f", pkt->pts * av_q2d(time_base)); > PRINT("\n"); > PRINT(" size=%d\n", pkt->size); > -#undef PRINT > if (dump_payload) > av_hex_dump(f, pkt->data, pkt->size); > }
PRINT is a little bit unspecific so the #undef is probably not a bad idea. move it out of the function though. otherwise ok Janne _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel