changeset 25402:f8f596bad3bd

Modified for using chapter property for $(NAME:TEXT) or ?(NAME:TEXT).
author ulion
date Mon, 17 Dec 2007 03:42:54 +0000
parents f3acd58a3eff
children e256d72c1f7a
files command.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Mon Dec 17 01:20:19 2007 +0000
+++ b/command.c	Mon Dec 17 03:42:54 2007 +0000
@@ -381,9 +381,12 @@
 
     switch (action) {
     case M_PROPERTY_GET:
+        chapter = demuxer_get_current_chapter(mpctx->demuxer);
+        if (chapter < 0)
+            return M_PROPERTY_UNAVAILABLE;
         if (!arg)
             return M_PROPERTY_ERROR;
-        *(int *) arg = demuxer_get_current_chapter(mpctx->demuxer);
+        *(int *) arg = chapter;
         return M_PROPERTY_OK;
     case M_PROPERTY_PRINT: {
         if (!arg)