vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Fri Jan 18 
21:13:25 2019 +0200| [abc6132f802ed64cb35d3af74377194e2fd6ea2d] | committer: 
Rémi Denis-Courmont

aout: do not use input resource for visualization

Since the recycle flag is always false, the video output is never
preserved, so tracking it in input resources is vain.

Creating and destroying the video output directly instead of
deferring to decoder callbacks is also more consistent with the
behaviour of the newer OpenGL-based visualizations.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=abc6132f802ed64cb35d3af74377194e2fd6ea2d
---

 src/audio_output/filters.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index d1b9dbecf7..3fdb68ca0b 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -36,10 +36,9 @@
 #include <vlc_modules.h>
 #include <vlc_aout.h>
 #include <vlc_filter.h>
-#include <vlc_vout.h>                  /* for vout_Request */
-
 #include <libvlc.h>
 #include "aout_internal.h"
+#include "../video_output/vout_internal.h" /* for vout_Request */
 
 static filter_t *CreateFilter (vlc_object_t *obj, const char *type,
                                const char *name, void *sys,
@@ -384,22 +383,18 @@ static int VisualizationCallback (vlc_object_t *obj, 
const char *var,
 
 vout_thread_t *aout_filter_GetVout(filter_t *filter, const video_format_t *fmt)
 {
-    /* NOTE: This only works from aout_filters_t.
-     * If you want to use visualization filters from another place, you will
-     * need to add a new pf_aout_request_vout callback or store a pointer
-     * to aout_request_vout_t inside filter_t (i.e. a level of indirection). */
-    const aout_request_vout_t *req = filter->owner.sys;
     video_format_t adj_fmt = *fmt;
+    vout_configuration_t cfg = { .fmt = &adj_fmt, .dpb_size = 1 };
 
     video_format_AdjustColorSpace(&adj_fmt);
-    return req->pf_request_vout(req->p_private, NULL, &adj_fmt);
+
+    return vout_Request(VLC_OBJECT(filter), &cfg, NULL);
 }
 
 void aout_filter_PutVout(filter_t *filter, vout_thread_t *vout)
 {
-    const aout_request_vout_t *req = filter->owner.sys;
-
-    req->pf_request_vout(req->p_private, vout, NULL);
+    assert(vout->obj.parent == VLC_OBJECT(filter));
+    vout_CloseAndRelease(vout);
 }
 
 static int AppendFilter(vlc_object_t *obj, const char *type, const char *name,

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to