]> git.sesse.net Git - vlc/blob - src/control/video.c
Fixed input_AddSubtitle(s) coherency.
[vlc] / src / control / video.c
1 /*****************************************************************************
2  * video.c: libvlc new API video functions
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
5  *
6  * $Id$
7  *
8  * Authors: Cl�ent Stenac <zorglub@videolan.org>
9  *          Filippo Carone <littlejohn@videolan.org>
10  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
11  *          Damien Fouilleul <damienf a_t videolan dot org>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26  *****************************************************************************/
27
28 #include "libvlc_internal.h"
29
30 #include <vlc/libvlc.h>
31 #include <vlc_input.h>
32 #include <vlc_vout.h>
33
34 /*
35  * Remember to release the returned vout_thread_t.
36  */
37 static vout_thread_t *GetVout( libvlc_media_player_t *p_mi,
38                                libvlc_exception_t *p_exception )
39 {
40     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_exception );
41     vout_thread_t *p_vout = NULL;
42
43     if( p_input_thread )
44     {
45         p_vout = vlc_object_find( p_input_thread, VLC_OBJECT_VOUT, FIND_CHILD );
46         if( !p_vout )
47         {
48             libvlc_exception_raise( p_exception, "No active video output" );
49         }
50         vlc_object_release( p_input_thread );
51     }
52     return p_vout;
53 }
54
55 /**********************************************************************
56  * Exported functions
57  **********************************************************************/
58
59 void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen,
60                             libvlc_exception_t *p_e )
61 {
62     /* We only work on the first vout */
63     vout_thread_t *p_vout = GetVout( p_mi, p_e );
64
65     /* GetVout will raise the exception for us */
66     if( !p_vout ) return;
67
68     var_SetBool( p_vout, "fullscreen", b_fullscreen );
69
70     vlc_object_release( p_vout );
71 }
72
73 int libvlc_get_fullscreen( libvlc_media_player_t *p_mi,
74                             libvlc_exception_t *p_e )
75 {
76     /* We only work on the first vout */
77     vout_thread_t *p_vout = GetVout( p_mi, p_e );
78     int i_ret;
79
80     /* GetVout will raise the exception for us */
81     if( !p_vout ) return 0;
82
83     i_ret = var_GetBool( p_vout, "fullscreen" );
84
85     vlc_object_release( p_vout );
86
87     return i_ret;
88 }
89
90 void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi,
91                                libvlc_exception_t *p_e )
92 {
93     /* We only work on the first vout */
94     vout_thread_t *p_vout = GetVout( p_mi, p_e );
95     bool ret;
96
97     /* GetVout will raise the exception for us */
98     if( !p_vout ) return;
99
100     ret = var_GetBool( p_vout, "fullscreen" );
101     var_SetBool( p_vout, "fullscreen", !ret );
102
103     vlc_object_release( p_vout );
104 }
105
106 void
107 libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, char *psz_filepath,
108         unsigned int i_width, unsigned int i_height, libvlc_exception_t *p_e )
109 {
110     vout_thread_t *p_vout = GetVout( p_mi, p_e );
111     input_thread_t *p_input_thread;
112
113     /* GetVout will raise the exception for us */
114     if( !p_vout ) return;
115
116     if( !psz_filepath )
117     {
118         libvlc_exception_raise( p_e, "filepath is null" );
119         return;
120     }
121
122     var_SetInteger( p_vout, "snapshot-width", i_width );
123     var_SetInteger( p_vout, "snapshot-height", i_height );
124
125     p_input_thread = p_mi->p_input_thread;
126     if( !p_mi->p_input_thread )
127     {
128         libvlc_exception_raise( p_e, "Input does not exist" );
129         return;
130     }
131
132     var_SetString( p_vout, "snapshot-path", psz_filepath );
133     var_SetString( p_vout, "snapshot-format", "png" );
134
135     vout_Control( p_vout, VOUT_SNAPSHOT );
136     vlc_object_release( p_vout );
137 }
138
139 int libvlc_video_get_height( libvlc_media_player_t *p_mi,
140                              libvlc_exception_t *p_e )
141 {
142     int height;
143
144     vout_thread_t *p_vout = GetVout( p_mi, p_e );
145     if( !p_vout ) return 0;
146
147     height = p_vout->i_window_height;
148
149     vlc_object_release( p_vout );
150
151     return height;
152 }
153
154 int libvlc_video_get_width( libvlc_media_player_t *p_mi,
155                             libvlc_exception_t *p_e )
156 {
157     int width;
158
159     vout_thread_t *p_vout = GetVout( p_mi, p_e );
160     if( !p_vout ) return 0;
161
162     width = p_vout->i_window_width;
163
164     vlc_object_release( p_vout );
165
166     return width;
167 }
168
169 int libvlc_media_player_has_vout( libvlc_media_player_t *p_mi,
170                                      libvlc_exception_t *p_e )
171 {
172     input_thread_t *p_input_thread = libvlc_get_input_thread(p_mi, p_e);
173     bool has_vout = false;
174
175     if( p_input_thread )
176     {
177         vout_thread_t *p_vout;
178
179         p_vout = vlc_object_find( p_input_thread, VLC_OBJECT_VOUT, FIND_CHILD );
180         if( p_vout )
181         {
182             has_vout = true;
183             vlc_object_release( p_vout );
184         }
185         vlc_object_release( p_input_thread );
186     }
187     return has_vout;
188 }
189
190 int libvlc_video_reparent( libvlc_media_player_t *p_mi, libvlc_drawable_t d,
191                            libvlc_exception_t *p_e )
192 {
193     vout_thread_t *p_vout = GetVout( p_mi, p_e );
194
195     if( p_vout )
196     {
197         vout_Control( p_vout , VOUT_REPARENT, d);
198         vlc_object_release( p_vout );
199     }
200     return 0;
201 }
202
203 void libvlc_video_resize( libvlc_media_player_t *p_mi, int width, int height, libvlc_exception_t *p_e )
204 {
205     vout_thread_t *p_vout = GetVout( p_mi, p_e );
206     if( p_vout )
207     {
208         vout_Control( p_vout, VOUT_SET_SIZE, width, height );
209         vlc_object_release( p_vout );
210     }
211 }
212
213 void libvlc_video_redraw_rectangle( libvlc_media_player_t *p_mi,
214                            const libvlc_rectangle_t *area,
215                            libvlc_exception_t *p_e )
216 {
217     if( (NULL != area)
218      && ((area->bottom - area->top) > 0)
219      && ((area->right - area->left) > 0) )
220     {
221         vout_thread_t *p_vout = GetVout( p_mi, p_e );
222         if( p_vout )
223         {
224             /* tell running vout to redraw area */
225             vout_Control( p_vout , VOUT_REDRAW_RECT,
226                                area->top, area->left, area->bottom, area->right );
227             vlc_object_release( p_vout );
228         }
229     }
230 }
231
232 /* global video settings */
233
234 /* Deprecated use libvlc_media_player_set_drawable() */
235 void libvlc_video_set_parent( libvlc_instance_t *p_instance, libvlc_drawable_t d,
236                               libvlc_exception_t *p_e )
237 {
238     /* set as default for future vout instances */
239     var_SetInteger(p_instance->p_libvlc_int, "drawable", (int)d);
240
241     libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
242     if( p_mi )
243     {
244         libvlc_media_player_set_drawable( p_mi, d, p_e );
245         libvlc_media_player_release(p_mi);
246     }
247 }
248
249 /* Deprecated use libvlc_media_player_get_drawable() */
250 libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
251 {
252     VLC_UNUSED(p_e);
253
254     libvlc_drawable_t result;
255
256     result = var_GetInteger( p_instance->p_libvlc_int, "drawable" );
257
258     return result;
259 }
260
261
262 void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height,
263                            libvlc_exception_t *p_e )
264 {
265     /* set as default for future vout instances */
266     config_PutInt(p_instance->p_libvlc_int, "width", width);
267     config_PutInt(p_instance->p_libvlc_int, "height", height);
268
269     libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
270     if( p_mi )
271     {
272         vout_thread_t *p_vout = GetVout( p_mi, p_e );
273         if( p_vout )
274         {
275             /* tell running vout to re-size */
276             vout_Control( p_vout , VOUT_SET_SIZE, width, height);
277             vlc_object_release( p_vout );
278         }
279         libvlc_media_player_release(p_mi);
280     }
281 }
282
283 void libvlc_video_set_viewport( libvlc_instance_t *p_instance,
284                             const libvlc_rectangle_t *view, const libvlc_rectangle_t *clip,
285                            libvlc_exception_t *p_e )
286 {
287     if( !view )
288     {
289         libvlc_exception_raise( p_e, "viewport is NULL" );
290         return;
291     }
292
293     /* if clip is NULL, then use view rectangle as clip */
294     if( !clip )
295         clip = view;
296
297     /* set as default for future vout instances */
298     var_SetInteger( p_instance->p_libvlc_int, "drawable-view-top", view->top );
299     var_SetInteger( p_instance->p_libvlc_int, "drawable-view-left", view->left );
300     var_SetInteger( p_instance->p_libvlc_int, "drawable-view-bottom", view->bottom );
301     var_SetInteger( p_instance->p_libvlc_int, "drawable-view-right", view->right );
302     var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-top", clip->top );
303     var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-left", clip->left );
304     var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-bottom", clip->bottom );
305     var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-right", clip->right );
306
307     libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
308     if( p_mi )
309     {
310         vout_thread_t *p_vout = GetVout( p_mi, p_e );
311         if( p_vout )
312         {
313             /* change viewport for running vout */
314             vout_Control( p_vout , VOUT_SET_VIEWPORT,
315                                view->top, view->left, view->bottom, view->right,
316                                clip->top, clip->left, clip->bottom, clip->right );
317             vlc_object_release( p_vout );
318         }
319         libvlc_media_player_release(p_mi);
320     }
321 }
322
323 char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi,
324                                      libvlc_exception_t *p_e )
325 {
326     char *psz_aspect = 0;
327     vout_thread_t *p_vout = GetVout( p_mi, p_e );
328
329     if( !p_vout ) return 0;
330
331     psz_aspect = var_GetNonEmptyString( p_vout, "aspect-ratio" );
332     vlc_object_release( p_vout );
333     return psz_aspect ? psz_aspect : strdup("");
334 }
335
336 void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi,
337                                     char *psz_aspect, libvlc_exception_t *p_e )
338 {
339     vout_thread_t *p_vout = GetVout( p_mi, p_e );
340     int i_ret = -1;
341
342     if( !p_vout ) return;
343
344     i_ret = var_SetString( p_vout, "aspect-ratio", psz_aspect );
345     if( i_ret )
346         libvlc_exception_raise( p_e,
347                         "Unexpected error while setting aspect-ratio value" );
348
349     vlc_object_release( p_vout );
350 }
351
352 int libvlc_video_get_spu( libvlc_media_player_t *p_mi,
353                           libvlc_exception_t *p_e )
354 {
355     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
356     vlc_value_t val_list;
357     vlc_value_t val;
358     int i_spu = -1;
359     int i_ret = -1;
360     int i;
361
362     if( !p_input_thread ) return -1;
363
364     i_ret = var_Get( p_input_thread, "spu-es", &val );
365     if( i_ret < 0 )
366     {
367         libvlc_exception_raise( p_e, "Getting subtitle information failed" );
368         vlc_object_release( p_input_thread );
369         return i_ret;
370     }
371
372     var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
373     for( i = 0; i < val_list.p_list->i_count; i++ )
374     {
375         vlc_value_t spu_val = val_list.p_list->p_values[i];
376         if( val.i_int == spu_val.i_int )
377         {
378             i_spu = i;
379             break;
380         }
381     }
382     vlc_object_release( p_input_thread );
383     return i_spu;
384 }
385
386 int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi,
387                                 libvlc_exception_t *p_e )
388 {
389     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
390     vlc_value_t val_list;
391
392     if( !p_input_thread )
393         return -1;
394
395     var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
396     vlc_object_release( p_input_thread );
397     return val_list.p_list->i_count;
398 }
399
400 libvlc_track_description_t *
401         libvlc_video_get_spu_description( libvlc_media_player_t *p_mi,
402                                           libvlc_exception_t *p_e )
403 {
404     return libvlc_get_track_description( p_mi, "spu-es", p_e);
405 }
406
407 void libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu,
408                            libvlc_exception_t *p_e )
409 {
410     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
411     vlc_value_t val_list;
412     vlc_value_t newval;
413     int i_ret = -1;
414
415     if( !p_input_thread ) return;
416
417     var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
418     if( (i_spu < 0) && (i_spu > val_list.p_list->i_count) )
419     {
420         libvlc_exception_raise( p_e, "Subtitle value out of range" );
421         vlc_object_release( p_input_thread );
422         return;
423     }
424
425     newval = val_list.p_list->p_values[i_spu];
426     i_ret = var_Set( p_input_thread, "spu-es", newval );
427     if( i_ret < 0 )
428     {
429         libvlc_exception_raise( p_e, "Setting subtitle value failed" );
430     }
431     vlc_object_release( p_input_thread );
432 }
433
434 int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi,
435                                     char *psz_subtitle,
436                                     libvlc_exception_t *p_e )
437 {
438     input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
439     bool b_ret = false;
440
441     if( p_input_thread )
442     {
443         if( !input_AddSubtitle( p_input_thread, psz_subtitle, true ) )
444             b_ret = true;
445         vlc_object_release( p_input_thread );
446     }
447     return b_ret;
448 }
449
450 libvlc_track_description_t *
451         libvlc_video_get_title_description( libvlc_media_player_t *p_mi,
452                                             libvlc_exception_t * p_e )
453 {
454     return libvlc_get_track_description( p_mi, "title", p_e);
455 }
456
457 libvlc_track_description_t *
458         libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi,
459                                               int i_title,
460                                               libvlc_exception_t *p_e )
461 {
462     char psz_title[12];
463     sprintf( psz_title,  "title %2i", i_title );
464     return libvlc_get_track_description( p_mi, psz_title, p_e);
465 }
466
467 char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi,
468                                    libvlc_exception_t *p_e )
469 {
470     char *psz_geometry = 0;
471     vout_thread_t *p_vout = GetVout( p_mi, p_e );
472
473     if( !p_vout ) return 0;
474
475     psz_geometry = var_GetNonEmptyString( p_vout, "crop" );
476     vlc_object_release( p_vout );
477     return psz_geometry ? psz_geometry : strdup("");
478 }
479
480 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi,
481                                     char *psz_geometry, libvlc_exception_t *p_e )
482 {
483     vout_thread_t *p_vout = GetVout( p_mi, p_e );
484     int i_ret = -1;
485
486     if( !p_vout ) return;
487
488     i_ret = var_SetString( p_vout, "crop", psz_geometry );
489     if( i_ret )
490         libvlc_exception_raise( p_e,
491                         "Unexpected error while setting crop geometry" );
492
493     vlc_object_release( p_vout );
494 }
495
496 int libvlc_video_get_teletext( libvlc_media_player_t *p_mi,
497                                libvlc_exception_t *p_e )
498 {
499     vout_thread_t *p_vout = GetVout( p_mi, p_e );
500     vlc_object_t *p_vbi;
501     int i_ret = -1;
502
503     if( !p_vout ) return i_ret;
504
505     p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi",
506                                                    FIND_ANYWHERE );
507     if( p_vbi )
508     {
509         i_ret = var_GetInteger( p_vbi, "vbi-page" );
510         vlc_object_release( p_vbi );
511     }
512
513     vlc_object_release( p_vout );
514     return i_ret;
515 }
516
517 void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page,
518                                 libvlc_exception_t *p_e )
519 {
520     vout_thread_t *p_vout = GetVout( p_mi, p_e );
521     vlc_object_t *p_vbi;
522     int i_ret = -1;
523
524     if( !p_vout ) return;
525
526     p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi",
527                                                    FIND_ANYWHERE );
528     if( p_vbi )
529     {
530         i_ret = var_SetInteger( p_vbi, "vbi-page", i_page );
531         vlc_object_release( p_vbi );
532         if( i_ret )
533             libvlc_exception_raise( p_e,
534                             "Unexpected error while setting teletext page" );
535     }
536     vlc_object_release( p_vout );
537 }
538
539 void libvlc_toggle_teletext( libvlc_media_player_t *p_mi,
540                              libvlc_exception_t *p_e )
541 {
542     input_thread_t *p_input_thread;
543     vlc_object_t *p_vbi;
544     int i_ret;
545
546     p_input_thread = libvlc_get_input_thread(p_mi, p_e);
547     if( !p_input_thread ) return;
548
549     p_vbi = (vlc_object_t *) vlc_object_find_name( p_input_thread, "zvbi",
550                                                    FIND_ANYWHERE );
551     if( p_vbi )
552     {
553         const int i_teletext_es = var_GetInteger( p_input_thread, "teletext-es" );
554         const int i_spu_es = var_GetInteger( p_input_thread, "spu-es" );
555
556         if( (i_teletext_es >= 0) && (i_teletext_es == i_spu_es) )
557         {
558             int i_page = 100;
559
560             i_page = var_GetInteger( p_vbi, "vbi-page" );
561             i_page = (i_teletext_es >= 0) ? i_page : 0;
562
563             i_ret = var_SetInteger( p_vbi, "vbi-page", i_page );
564             if( i_ret )
565                 libvlc_exception_raise( p_e,
566                                 "Unexpected error while setting teletext page" );
567         }
568         else if( i_teletext_es >= 0 )
569         {
570             bool opaque = true;
571
572             opaque = var_GetBool( p_vbi, "vbi-opaque" );
573             i_ret = var_SetBool( p_vbi, "vbi-opaque", !opaque );
574             if( i_ret )
575                 libvlc_exception_raise( p_e,
576                                 "Unexpected error while setting teletext transparency" );
577         }
578         vlc_object_release( p_vbi );
579     }
580     else
581     {
582         /* Teletext is not enabled yet, so enable it.
583          * Only after it is enable it is possible to view teletext pages
584          */
585         const int i_teletext_es = var_GetInteger( p_input_thread, "teletext-es" );
586
587         if( i_teletext_es >= 0 )
588         {
589             const int i_spu_es = var_GetInteger( p_input_thread, "spu-es" );
590
591             if( i_teletext_es == i_spu_es )
592                 var_SetInteger( p_input_thread, "spu-es", -1 );
593             else
594                 var_SetInteger( p_input_thread, "spu-es", i_teletext_es );
595         }
596     }
597     vlc_object_release( p_input_thread );
598 }
599
600 int libvlc_video_get_track_count( libvlc_media_player_t *p_mi,
601                                   libvlc_exception_t *p_e )
602 {
603     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
604     vlc_value_t val_list;
605
606     if( !p_input_thread )
607         return -1;
608
609     var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL );
610     vlc_object_release( p_input_thread );
611     return val_list.p_list->i_count;
612 }
613
614 libvlc_track_description_t *
615         libvlc_video_get_track_description( libvlc_media_player_t *p_mi,
616                                             libvlc_exception_t *p_e )
617 {
618     return libvlc_get_track_description( p_mi, "video-es", p_e);
619 }
620
621 int libvlc_video_get_track( libvlc_media_player_t *p_mi,
622                             libvlc_exception_t *p_e )
623 {
624     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
625     vlc_value_t val_list;
626     vlc_value_t val;
627     int i_track = -1;
628     int i_ret = -1;
629     int i;
630
631     if( !p_input_thread )
632         return -1;
633
634     i_ret = var_Get( p_input_thread, "video-es", &val );
635     if( i_ret < 0 )
636     {
637         libvlc_exception_raise( p_e, "Getting Video track information failed" );
638         vlc_object_release( p_input_thread );
639         return i_ret;
640     }
641
642     var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL );
643     for( i = 0; i < val_list.p_list->i_count; i++ )
644     {
645         vlc_value_t track_val = val_list.p_list->p_values[i];
646         if( track_val.i_int == val.i_int )
647         {
648             i_track = i;
649             break;
650        }
651     }
652     vlc_object_release( p_input_thread );
653     return i_track;
654 }
655
656 void libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track,
657                              libvlc_exception_t *p_e )
658 {
659     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
660     vlc_value_t val_list;
661     int i_ret = -1;
662     int i;
663
664     if( !p_input_thread )
665         return;
666
667     var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL );
668     for( i = 0; i < val_list.p_list->i_count; i++ )
669     {
670         vlc_value_t val = val_list.p_list->p_values[i];
671         if( i_track == val.i_int )
672         {
673             i_ret = var_Set( p_input_thread, "audio-es", val );
674             if( i_ret < 0 )
675                 libvlc_exception_raise( p_e, "Setting video track failed" );
676             vlc_object_release( p_input_thread );
677             return;
678         }
679     }
680     libvlc_exception_raise( p_e, "Video track out of range" );
681     vlc_object_release( p_input_thread );
682 }
683
684 int libvlc_video_destroy( libvlc_media_player_t *p_mi,
685                           libvlc_exception_t *p_e )
686 {
687     vout_thread_t *p_vout = GetVout( p_mi, p_e );
688     vlc_object_detach( p_vout );
689     vlc_object_release( p_vout );
690     vlc_object_release( p_vout );
691
692     return 0;
693 }