summaryrefslogtreecommitdiffstats
path: root/mpcommon.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-04-09 05:14:55 +0300
committerUoti Urpala <uau@mplayer2.org>2011-04-20 04:22:52 +0300
commitbdfdece245b5aa863b4c57996c38b5638d7797d0 (patch)
tree3036399e13ea08cc44019d1e7208295f47226865 /mpcommon.h
parent7221e28fe3d743aaf6357bb0838e762781644f0d (diff)
downloadmpv-bdfdece245b5aa863b4c57996c38b5638d7797d0.tar.bz2
mpv-bdfdece245b5aa863b4c57996c38b5638d7797d0.tar.xz
subs: move vobsub loading logic down to find_subfiles.c
Analogously to the previous commit, move path handling logic for loading external vobsub files from mplayer.c to find_subfiles.c. Based on a commit from Clément Bœsch but fixed and simplified.
Diffstat (limited to 'mpcommon.h')
-rw-r--r--mpcommon.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/mpcommon.h b/mpcommon.h
index bc35934e41..fd520eacf6 100644
--- a/mpcommon.h
+++ b/mpcommon.h
@@ -25,6 +25,11 @@
#define ROUND(x) ((int)((x) < 0 ? (x) - 0.5 : (x) + 0.5))
#define MP_TALLOC_ELEMS(p) (talloc_get_size(p) / sizeof((p)[0]))
+#define MP_GROW_ARRAY(p, nextidx) do { \
+ if ((nextidx) == MP_TALLOC_ELEMS(p)) \
+ p = talloc_realloc_size(NULL, p, talloc_get_size(p) * 2); } while (0)
+#define MP_RESIZE_ARRAY(ctx, p, count) do { \
+ p = talloc_realloc_size((ctx), p, (count) * sizeof(p[0])); } while (0)
extern const char *mplayer_version;