From bdfdece245b5aa863b4c57996c38b5638d7797d0 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 9 Apr 2011 05:14:55 +0300 Subject: subs: move vobsub loading logic down to find_subfiles.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- mpcommon.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mpcommon.h') 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; -- cgit v1.2.3