Re: [FFmpeg-devel] [PATCH] ffplay: force setting alsa buffer size

2016-05-07 Thread Marton Balint


On Sun, 1 May 2016, Reimar Döffinger wrote:


On Sat, Apr 30, 2016 at 10:17:33PM +0200, Marton Balint wrote:

Signed-off-by: Marton Balint 
---
 ffplay.c | 7 +++
 1 file changed, 7 insertions(+)


I have a nagging feeling someone with better knowledge
of ALSA and how we handle it might find a better solution,
but since I doubt someone will spend time on it, this
seems like an acceptable workaround to me.


Ok, thanks. Applied.

Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffplay: force setting alsa buffer size

2016-05-01 Thread Reimar Döffinger
On Sat, Apr 30, 2016 at 10:17:33PM +0200, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  ffplay.c | 7 +++
>  1 file changed, 7 insertions(+)

I have a nagging feeling someone with better knowledge
of ALSA and how we handle it might find a better solution,
but since I doubt someone will spend time on it, this
seems like an acceptable workaround to me.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffplay: force setting alsa buffer size

2016-04-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 ffplay.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 804bcbc..d5fcde8 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3781,6 +3781,7 @@ int main(int argc, char **argv)
 int flags;
 VideoState *is;
 char dummy_videodriver[] = "SDL_VIDEODRIVER=dummy";
+char alsa_bufsize[] = "SDL_AUDIO_ALSA_SET_BUFFER_SIZE=1";
 
 av_log_set_flags(AV_LOG_SKIP_REPEATED);
 parse_loglevel(argc, argv, options);
@@ -3818,6 +3819,12 @@ int main(int argc, char **argv)
 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
 if (audio_disable)
 flags &= ~SDL_INIT_AUDIO;
+else {
+/* Try to work around an occasional ALSA buffer underflow issue when 
the
+ * period size is NPOT due to ALSA resampling by forcing the buffer 
size. */
+if (!SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE"))
+SDL_putenv(alsa_bufsize);
+}
 if (display_disable)
 SDL_putenv(dummy_videodriver); /* For the event queue, we always need 
a video driver. */
 #if !defined(_WIN32) && !defined(__APPLE__)
-- 
2.6.6

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel