[vlc-commits] [Git][videolan/vlc][master] 2 commits: test: player: use dummy resampler with aout
François Cartegnie (@fcartegnie)
gitlab at videolan.org
Tue Dec 12 09:06:38 UTC 2023
François Cartegnie pushed to branch master at VideoLAN / VLC
Commits:
1f828a38 by François Cartegnie at 2023-12-12T08:46:14+00:00
test: player: use dummy resampler with aout
- - - - -
9bc7ded0 by François Cartegnie at 2023-12-12T08:46:14+00:00
test: player: do not fallback outside of test modules
- - - - -
1 changed file:
- test/src/player/player.c
Changes:
=====================================
test/src/player/player.c
=====================================
@@ -27,6 +27,7 @@
#include <vlc_player.h>
#include <vlc_vector.h>
#include <vlc_modules.h>
+#include <vlc_filter.h>
#if defined(ZVBI_COMPILED)
# define TELETEXT_DECODER "zvbi,"
@@ -2181,11 +2182,11 @@ ctx_init(struct ctx *ctx, enum ctx_flags flags)
/* Avoid leaks from various dlopen... */
"--codec=araw,rawvideo,subsdec,"TELETEXT_DECODER"none",
"--dec-dev=none",
- (flags & DISABLE_VIDEO_OUTPUT) ? "--vout=none" : "--vout=dummy",
- (flags & DISABLE_AUDIO_OUTPUT) ? "--aout=none" : "--aout=test_src_player",
+ (flags & DISABLE_VIDEO_OUTPUT) ? "--vout=none" : "--vout=dummy,none",
+ (flags & DISABLE_AUDIO_OUTPUT) ? "--aout=none" : "--aout=test_src_player,none",
(flags & DISABLE_VIDEO) ? "--no-video" : "--video",
(flags & DISABLE_AUDIO) ? "--no-audio" : "--audio",
- "--text-renderer=tdummy",
+ "--text-renderer=tdummy,none",
#ifdef TEST_CLOCK_MONOTONIC
"--clock-master=monotonic",
#endif
@@ -3072,6 +3073,26 @@ static int aout_Open(vlc_object_t *obj)
return VLC_SUCCESS;
}
+static block_t *resampler_Resample(filter_t *filter, block_t *in)
+{
+ VLC_UNUSED(filter);
+ return in;
+}
+
+static void resampler_Close(filter_t *filter)
+{
+ VLC_UNUSED(filter);
+}
+
+static int resampler_Open(vlc_object_t *obj)
+{
+ filter_t *filter = (filter_t *)obj;
+ static const struct vlc_filter_operations filter_ops =
+ { .filter_audio = resampler_Resample, .close = resampler_Close, };
+ filter->ops = &filter_ops;
+ return VLC_SUCCESS;
+}
+
vlc_module_begin()
/* This aout module will report audio timings perfectly, but without any
* delay, in order to be usable for player tests. Indeed, this aout will
@@ -3079,6 +3100,11 @@ vlc_module_begin()
* future (like when aout->time_get() is used). */
set_capability("audio output", 0)
set_callbacks(aout_Open, aout_Close)
+ add_submodule ()
+ /* aout will insert a resampler that can have samples delay, even for 1:1
+ * Insert our own resampler that keeps blocks and pts untouched. */
+ set_capability ("audio resampler", 9999)
+ set_callback (resampler_Open)
vlc_module_end()
VLC_EXPORT const vlc_plugin_cb vlc_static_modules[] = {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3dfc7ca7e3c5df8d1026e9983167192ba6fe0ba7...9bc7ded0f0e3a06b8ad4b00fdcadca1debf1ca9f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3dfc7ca7e3c5df8d1026e9983167192ba6fe0ba7...9bc7ded0f0e3a06b8ad4b00fdcadca1debf1ca9f
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list