media-video/vlc: Drop USE=media-library, fix some ALSA issues
authorAndreas Sturmlechner <andreas.sturmlechner@gmail.com>
Sat, 26 Nov 2016 15:34:39 +0000 (16:34 +0100)
committerMichael Palimaka <kensington@gentoo.org>
Sat, 26 Nov 2016 18:00:09 +0000 (05:00 +1100)
Upstream seems unwilling to fix it in 2.2 branch.

Gentoo-bug: 594126, 592784

Package-Manager: portage-2.3.0

media-video/vlc/files/vlc-2.2.4-alsa-large-buffers.patch [new file with mode: 0644]
media-video/vlc/files/vlc-2.2.4-decoder-lock-scope.patch [new file with mode: 0644]
media-video/vlc/metadata.xml
media-video/vlc/vlc-2.2.1-r1.ebuild
media-video/vlc/vlc-2.2.4.ebuild
media-video/vlc/vlc-2.2.9999.ebuild

diff --git a/media-video/vlc/files/vlc-2.2.4-alsa-large-buffers.patch b/media-video/vlc/files/vlc-2.2.4-alsa-large-buffers.patch
new file mode 100644 (file)
index 0000000..b5a9ff7
--- /dev/null
@@ -0,0 +1,47 @@
+X-Git-Url: https://git.videolan.org/?p=vlc.git;a=blobdiff_plain;f=modules%2Faudio_output%2Falsa.c;h=4e9fd53592d048baa8b57f30df15ab5806139d07;hp=2d1f99e9cb743bca12c6bdf32cc84a92d07fda8b;hb=47f74a83c161173b0d15e95dab8ceb7c97de51b4;hpb=6ae2905ef7fbc7de3a3a4a1bdf8ad6df46ce570a
+
+diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
+index 2d1f99e..4e9fd53 100644
+--- a/modules/audio_output/alsa.c
++++ b/modules/audio_output/alsa.c
+@@ -495,6 +495,15 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
+     }
+     sys->rate = fmt->i_rate;
++#if 1 /* work-around for period-long latency outputs (e.g. PulseAudio): */
++    param = AOUT_MIN_PREPARE_TIME;
++    val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL);
++    if (val)
++    {
++        msg_Err (aout, "cannot set period: %s", snd_strerror (val));
++        goto error;
++    }
++#endif
+     /* Set buffer size */
+     param = AOUT_MAX_ADVANCE_TIME;
+     val = snd_pcm_hw_params_set_buffer_time_near (pcm, hw, &param, NULL);
+@@ -503,14 +512,22 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
+         msg_Err (aout, "cannot set buffer duration: %s", snd_strerror (val));
+         goto error;
+     }
+-
+-    param = AOUT_MIN_PREPARE_TIME;
++#if 0
++    val = snd_pcm_hw_params_get_buffer_time (hw, &param, NULL);
++    if (val)
++    {
++        msg_Warn (aout, "cannot get buffer time: %s", snd_strerror(val));
++        param = AOUT_MIN_PREPARE_TIME;
++    }
++    else
++        param /= 2;
+     val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL);
+     if (val)
+     {
+         msg_Err (aout, "cannot set period: %s", snd_strerror (val));
+         goto error;
+     }
++#endif
+     /* Commit hardware parameters */
+     val = snd_pcm_hw_params (pcm, hw);
diff --git a/media-video/vlc/files/vlc-2.2.4-decoder-lock-scope.patch b/media-video/vlc/files/vlc-2.2.4-decoder-lock-scope.patch
new file mode 100644 (file)
index 0000000..51a2cdc
--- /dev/null
@@ -0,0 +1,47 @@
+X-Git-Url: https://git.videolan.org/?p=vlc.git;a=blobdiff_plain;f=src%2Finput%2Fdecoder.c;h=fe3cd428c65c18bfbdadb55baf11521afdc2bfc7;hp=83aa5bf54e2c29ad93fae803117558e4fcd0f658;hb=6ae2905ef7fbc7de3a3a4a1bdf8ad6df46ce570a;hpb=5b2de76965ee8b1ab5e3257f8b6d71bbb4e9e3f9
+
+--- a/src/input/decoder.c
++++ b/src/input/decoder.c
+@@ -1162,7 +1162,10 @@
+         b_paused = p_owner->b_paused;
+         if (!p_audio)
++        {
++            vlc_mutex_unlock( &p_owner->lock );
+             break;
++        }
+         /* */
+         int i_rate = INPUT_RATE_DEFAULT;
+@@ -1180,6 +1183,9 @@
+         if( unlikely(p_owner->b_paused != b_paused) )
+             continue; /* race with input thread? retry... */
++
++        vlc_mutex_unlock( &p_owner->lock );
++
+         if( p_aout == NULL )
+             b_reject = true;
+@@ -1199,7 +1205,6 @@
+         break;
+     }
+-    vlc_mutex_unlock( &p_owner->lock );
+ }
+ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
+@@ -1961,11 +1966,10 @@
+         /* Parameters changed, restart the aout */
+         vlc_mutex_lock( &p_owner->lock );
+-
+-        aout_DecDelete( p_owner->p_aout );
+         p_owner->p_aout = NULL;
+-
+         vlc_mutex_unlock( &p_owner->lock );
++        aout_DecDelete( p_owner->p_aout );
++
+         input_resource_PutAout( p_owner->p_resource, p_aout );
+     }
index ec1f07dca68db87363f990cac688c7fecd82cdd1..a1e47068a43d18e501cafc240ae8a7f8dbe0876d 100644 (file)
@@ -47,7 +47,6 @@
                <flag name="macosx-quartztext">Enables Mac OS X quartz text module.</flag>
                <flag name="macosx-qtkit">Enables Mac OS X qtkit module: qtcapture (video) and qtsound (audio) module.</flag>
                <flag name="matroska">Enables matroska support using reference libraries (fallback on other existing matroska support if disabled, i.e., matroska enabled FFmpeg)</flag>
-               <flag name="media-library">Build the (sqlite based) media library.</flag>
                <flag name="mpeg">Add libmpeg2 support for mpeg-1 and mpeg-2 video streams</flag>
                <flag name="omxil">Enables OpenMAX Integration Layer codec module.</flag>
                <flag name="optimisememory">Enable optimisation for memory rather than performance.</flag>
index 59b277c7cb4b9df0af34e1a9c73c4333257d322d..1d3bc722caa230939a3375a060c65c0acdc25067 100644 (file)
@@ -45,7 +45,7 @@ IUSE="a52 aalib alsa altivec atmo +audioqueue +avcodec
        growl httpd ieee1394 jack jpeg kate kde libass libav libcaca libnotify
        +libsamplerate libtiger linsys libtar lirc live lua
        macosx-dialog-provider macosx-eyetv macosx-quartztext macosx-qtkit
-       matroska media-library cpu_flags_x86_mmx modplug mp3 mpeg
+       matroska cpu_flags_x86_mmx modplug mp3 mpeg
        mtp musepack ncurses neon ogg omxil opencv opengl optimisememory opus
        png postproc projectm pulseaudio +qt4 qt5 rdp rtsp run-as-root samba
        schroedinger sdl sdl-image sftp shout sid skins speex cpu_flags_x86_sse svg +swscale
index a165e1ddd098d52796b7850424cf6fa78fbd8923..f5ab6f902bfefb9b3dd7463807e0d53de3d4fb2b 100644 (file)
@@ -45,7 +45,7 @@ IUSE="a52 aalib alsa altivec atmo +audioqueue +avcodec
        growl httpd ieee1394 jack jpeg kate kde libass libav libcaca libnotify
        +libsamplerate libtiger linsys libtar lirc live lua
        macosx-dialog-provider macosx-eyetv macosx-quartztext macosx-qtkit
-       matroska media-library cpu_flags_x86_mmx modplug mp3 mpeg
+       matroska cpu_flags_x86_mmx modplug mp3 mpeg
        mtp musepack ncurses neon ogg omxil opencv opengl optimisememory opus
        png postproc projectm pulseaudio +qt4 qt5 rdp rtsp run-as-root samba
        schroedinger sdl sdl-image sftp shout sid skins speex cpu_flags_x86_sse svg +swscale
index 70477211516cd924e76b8672edbe40878f7b0e1d..8c5988fb3b3fc23626b710b2bee383fd96ada5ac 100644 (file)
@@ -45,7 +45,7 @@ IUSE="a52 aalib alsa altivec atmo +audioqueue +avcodec
        growl gstreamer httpd ieee1394 jack jpeg kate kde libass libav libcaca libnotify
        +libsamplerate libtiger linsys libtar lirc live lua
        macosx-dialog-provider macosx-eyetv macosx-quartztext macosx-qtkit
-       matroska media-library cpu_flags_x86_mmx modplug mp3 mpeg
+       matroska cpu_flags_x86_mmx modplug mp3 mpeg
        mtp musepack ncurses neon ogg omxil opencv opengl optimisememory opus
        png +postproc projectm pulseaudio +qt4 qt5 rdp rtsp run-as-root samba
        schroedinger sdl sdl-image sftp shout sid skins speex cpu_flags_x86_sse svg +swscale
@@ -224,6 +224,10 @@ PATCHES=(
 
        # Bug #589396
        "${FILESDIR}"/${PN}-2.2.4-cxx0x.patch
+
+       # Bug #594126
+       "${FILESDIR}"/${PN}-2.2.4-decoder-lock-scope.patch
+       "${FILESDIR}"/${PN}-2.2.4-alsa-large-buffers.patch
 )
 
 DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt doc/intf-vcd.txt )