diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2013-08-08 20:02:46 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2013-08-08 20:32:40 +0200 |
commit | a48979d7155934153d0647e18c63c8993b18b026 (patch) | |
tree | 57ee452d6d7482921085250c4c1ac9e6924a601a /libavutil | |
parent | 55a88daf6ff1e09994bff39fac313a38a35b0055 (diff) | |
download | ffmpeg-a48979d7155934153d0647e18c63c8993b18b026.tar.gz |
Reduce MAKE_ACCESSORS code duplication via a new header.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/accessors.h | 3 | ||||
-rw-r--r-- | libavutil/frame.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/libavutil/accessors.h b/libavutil/accessors.h new file mode 100644 index 0000000000..471cdff7f6 --- /dev/null +++ b/libavutil/accessors.h @@ -0,0 +1,3 @@ +#define MAKE_ACCESSORS(str, name, type, field) \ + type av_##name##_get_##field(const str *s) { return s->field; } \ + void av_##name##_set_##field(str *s, type v) { s->field = v; } diff --git a/libavutil/frame.c b/libavutil/frame.c index 5021d0774e..df03e258db 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -27,9 +27,7 @@ #include "mem.h" #include "samplefmt.h" -#define MAKE_ACCESSORS(str, name, type, field) \ - type av_##name##_get_##field(const str *s) { return s->field; } \ - void av_##name##_set_##field(str *s, type v) { s->field = v; } +#include "accessors.h" MAKE_ACCESSORS(AVFrame, frame, int64_t, best_effort_timestamp) MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_duration) |