From cc95355a0a4d88306e4af0323818e694718a8e8e Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 26 Jan 2010 21:08:01 +0000 Subject: [PATCH 1/3] Remove ds_fill_buffer calls from demux_resync, they cause issues at least with the ASF demuxer (seek seems to end up right after the keyframe?) and seem to have no purpose anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30438 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demuxer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 15960c9ae3..5d4798470a 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -1201,17 +1201,20 @@ demuxer_t *demux_open(stream_t *vs, int file_format, int audio_id, return res; } +/** + * Do necessary reinitialization after e.g. a seek. + * Do _not_ call ds_fill_buffer between the seek and this, it breaks at least + * seeking with ASF demuxer. + */ static void demux_resync(demuxer_t *demuxer) { sh_video_t *sh_video = demuxer->video->sh; sh_audio_t *sh_audio = demuxer->audio->sh; demux_control(demuxer, DEMUXER_CTRL_RESYNC, NULL); if (sh_video) { - ds_fill_buffer(demuxer->video); resync_video_stream(sh_video); } if (sh_audio) { - ds_fill_buffer(demuxer->audio); resync_audio_stream(sh_audio); } } From 7be89f904dc3e6daa001e17e66a7a6edbff39c22 Mon Sep 17 00:00:00 2001 From: stefano Date: Wed, 27 Jan 2010 00:25:23 +0000 Subject: [PATCH 2/3] Rename swscale-example to swscale-test, to better reflect the intended use of the program. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30439 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/Makefile | 3 +-- libswscale/{swscale-example.c => swscale-test.c} | 0 2 files changed, 1 insertion(+), 2 deletions(-) rename libswscale/{swscale-example.c => swscale-test.c} (100%) diff --git a/libswscale/Makefile b/libswscale/Makefile index 085027789e..9ae28e07ef 100644 --- a/libswscale/Makefile +++ b/libswscale/Makefile @@ -16,8 +16,7 @@ OBJS-$(HAVE_VIS) += sparc/yuv2rgb_vis.o MMX-OBJS-$(CONFIG_GPL) += x86/yuv2rgb_mmx.o \ -EXAMPLES = swscale -TESTPROGS = colorspace +TESTPROGS = colorspace swscale DIRS = bfin mlib ppc sparc x86 diff --git a/libswscale/swscale-example.c b/libswscale/swscale-test.c similarity index 100% rename from libswscale/swscale-example.c rename to libswscale/swscale-test.c From 01a39f2fc3528481374a8a47e138b622e419f67b Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 18:10:07 +0000 Subject: [PATCH 3/3] Do not needlessly use (file-)global variables. Since they also were initialized to a value and non-constant (changed by ALSA) this might actually have caused bugs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30440 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index ac9bb3b115..1ad746123a 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -72,14 +72,10 @@ static snd_pcm_format_t alsa_format; static snd_pcm_hw_params_t *alsa_hwparams; static snd_pcm_sw_params_t *alsa_swparams; -static unsigned int alsa_buffer_time = 500000; /* 0.5 s */ -static unsigned int alsa_fragcount = 16; - static size_t bytes_per_sample; static int ao_noblock = 0; -static int open_mode; static int alsa_can_pause = 0; #define ALSA_DEVICE_SIZE 256 @@ -319,6 +315,9 @@ static int try_open_device(const char *device, int open_mode, int try_ac3) */ static int init(int rate_hz, int channels, int format, int flags) { + unsigned int alsa_buffer_time = 500000; /* 0.5 s */ + unsigned int alsa_fragcount = 16; + int open_mode; int err; int block; strarg_t device;