]> git.sesse.net Git - vlc/commitdiff
Mozilla: Yet more input->media_instance changes.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 19 Jun 2007 20:35:05 +0000 (20:35 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 19 Jun 2007 20:35:05 +0000 (20:35 +0000)
mozilla/control/npovlc.cpp

index 050411c733d4d72f6e5baa8f9c9aa1f63454a8f9..db92880030bcc3a4a305fc95585e11bcfdd87371 100755 (executable)
@@ -165,11 +165,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_fullscreen: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
-                    if( p_input )\r
+                    libvlc_media_instance_t *p_md = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+                    if( p_md )\r
                     {\r
-                        libvlc_toggle_fullscreen(p_input, &ex);\r
-                        libvlc_input_free(p_input);\r
+                        libvlc_toggle_fullscreen(p_md, &ex);\r
+                        libvlc_media_instance_destroy_and_detach(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -529,11 +529,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_get_length: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
-                    if( p_input )\r
+                    libvlc_media_instance_t *p_md = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+                    if( p_md )\r
                     {\r
-                        vlc_int64_t val = libvlc_input_get_length(p_input, &ex);\r
-                        libvlc_input_free(p_input);\r
+                        vlc_int64_t val = libvlc_media_instance_get_length(p_md, &ex);\r
+                        libvlc_media_instance_destroy_and_detach(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -561,11 +561,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_get_position: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
-                    if( p_input )\r
+                    libvlc_media_instance_t *p_md = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+                    if( p_md )\r
                     {\r
-                        float val = libvlc_input_get_position(p_input, &ex);\r
-                        libvlc_input_free(p_input);\r
+                        float val = libvlc_media_instance_get_position(p_md, &ex);\r
+                        libvlc_media_instance_destroy_and_detach(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -593,11 +593,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_get_time: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
-                    if( p_input )\r
+                    libvlc_media_instance_t *p_md = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+                    if( p_md )\r
                     {\r
-                        vlc_int64_t val = libvlc_input_get_time(p_input, &ex);\r
-                        libvlc_input_free(p_input);\r
+                        vlc_int64_t val = libvlc_media_instance_get_time(p_md, &ex);\r
+                        libvlc_media_instance_destroy_and_detach(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -627,8 +627,8 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
                   && isNumberValue(args[0])\r
                   && NPVARIANT_IS_BOOLEAN(args[1]) )\r
                 {\r
-                    libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
-                    if( p_input )\r
+                    libvlc_media_instance_t *p_md = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+                    if( p_md )\r
                     {\r
                         vlc_int64_t pos = 0;\r
                         if( NPVARIANT_IS_INT32(args[0]) )\r
@@ -639,10 +639,10 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
                         if( NPVARIANT_TO_BOOLEAN(args[1]) )\r
                         {\r
                             /* relative seek */\r
-                            vlc_int64_t from = libvlc_input_get_time(p_input, &ex);\r
+                            vlc_int64_t from = libvlc_media_instance_get_time(p_md, &ex);\r
                             if( libvlc_exception_raised(&ex) )\r
                             {\r
-                                libvlc_input_free(p_input);\r
+                                libvlc_media_instance_destroy_and_detach(p_md);\r
                                 NPN_SetException(this, libvlc_exception_get_message(&ex));\r
                                 libvlc_exception_clear(&ex);\r
                                 return INVOKERESULT_GENERIC_ERROR;\r
@@ -650,8 +650,8 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
                             pos += from;\r
                         }\r
                         /* jump to time */\r
-                        libvlc_input_set_time(p_input, pos, &ex);\r
-                        libvlc_input_free(p_input);\r
+                        libvlc_media_instance_set_time(p_md, pos, &ex);\r
+                        libvlc_media_instance_destroy_and_detach(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r