changeset 31788:2961296ee903

Move function to avoid a forward declaration.
author reimar
date Thu, 29 Jul 2010 17:06:39 +0000
parents a60157df1f1f
children ec31654440af
files command.c
diffstat 1 files changed, 24 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Thu Jul 29 17:05:23 2010 +0000
+++ b/command.c	Thu Jul 29 17:06:39 2010 +0000
@@ -98,32 +98,6 @@
            vo_dheight, vo_fs);
 }
 
-static int sub_pos_by_source(MPContext *mpctx, int src);
-
-static void update_global_sub_size(MPContext *mpctx)
-{
-    int i;
-    int cnt = 0;
-
-    // update number of demuxer sub streams
-    for (i = 0; i < MAX_S_STREAMS; i++)
-        if (mpctx->demuxer->s_streams[i])
-            cnt++;
-    if (cnt > mpctx->sub_counts[SUB_SOURCE_DEMUX])
-        mpctx->sub_counts[SUB_SOURCE_DEMUX] = cnt;
-
-    // update global size
-    mpctx->global_sub_size = 0;
-    for (i = 0; i < SUB_SOURCES; i++)
-        mpctx->global_sub_size += mpctx->sub_counts[i];
-
-    // update global_sub_pos if we auto-detected a demuxer sub
-    if (mpctx->global_sub_pos == -1 &&
-        mpctx->demuxer->sub && mpctx->demuxer->sub->id >= 0)
-        mpctx->global_sub_pos = sub_pos_by_source(mpctx, SUB_SOURCE_DEMUX) +
-                                mpctx->demuxer->sub->id;
-}
-
 static int sub_pos_by_source(MPContext *mpctx, int src)
 {
     int i, cnt = 0;
@@ -167,6 +141,30 @@
     return sub_source_by_pos(mpctx, mpctx->global_sub_pos);
 }
 
+static void update_global_sub_size(MPContext *mpctx)
+{
+    int i;
+    int cnt = 0;
+
+    // update number of demuxer sub streams
+    for (i = 0; i < MAX_S_STREAMS; i++)
+        if (mpctx->demuxer->s_streams[i])
+            cnt++;
+    if (cnt > mpctx->sub_counts[SUB_SOURCE_DEMUX])
+        mpctx->sub_counts[SUB_SOURCE_DEMUX] = cnt;
+
+    // update global size
+    mpctx->global_sub_size = 0;
+    for (i = 0; i < SUB_SOURCES; i++)
+        mpctx->global_sub_size += mpctx->sub_counts[i];
+
+    // update global_sub_pos if we auto-detected a demuxer sub
+    if (mpctx->global_sub_pos == -1 &&
+        mpctx->demuxer->sub && mpctx->demuxer->sub->id >= 0)
+        mpctx->global_sub_pos = sub_pos_by_source(mpctx, SUB_SOURCE_DEMUX) +
+                                mpctx->demuxer->sub->id;
+}
+
 /**
  * \brief Log the currently displayed subtitle to a file
  *