History

swresample: Fix swr_drop_output so it does not flush the buffers

Michael Niedermayer committed 12 years ago

Commit e4f8a971 parent dc351e12 files · +10 −9Browse files

Unified · Split

2 files
  1. libswresample/swresample.c +2 −1
  2. tests/fate/libswresample.mak +8 −8
libswresample/swresample.c+2−1
@@ -752,13 +752,14 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun · 751 unmodified lines
752752 }
753753
754754 int swr_drop_output(struct SwrContext *s, int count){
755+ const uint8_t *tmp_arg[SWR_CH_MAX];
755756 s->drop_output += count;
756757
757758 if(s->drop_output <= 0)
758759 return 0;
759760
760761 av_log(s, AV_LOG_VERBOSE, "discarding %d audio samples\n", count);
761− return swr_convert(s, NULL, s->drop_output, NULL, 0);
762+ return swr_convert(s, NULL, s->drop_output, tmp_arg, 0);
762763 }
763764
764765 int swr_inject_silence(struct SwrContext *s, int count){
tests/fate/libswresample.mak+8−8
@@ -365,17 +365,17 @@ fate-swr-resample_async-$(3)-$(1)-$(2): FUZZ = 0.1 · 364 unmodified lines
365365 fate-swr-resample_async-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav
366366 endef
367367
368−fate-swr-resample_async-fltp-44100-8000: CMP_TARGET = 4047.25
369−fate-swr-resample_async-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20132
368+fate-swr-resample_async-fltp-44100-8000: CMP_TARGET = 4031.60
369+fate-swr-resample_async-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20310
370370
371−fate-swr-resample_async-fltp-8000-44100: CMP_TARGET = 11193.77
372−fate-swr-resample_async-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20312
371+fate-swr-resample_async-fltp-8000-44100: CMP_TARGET = 11185.34
372+fate-swr-resample_async-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20344
373373
374−fate-swr-resample_async-s16p-44100-8000: CMP_TARGET = 4047.24
375−fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20132
374+fate-swr-resample_async-s16p-44100-8000: CMP_TARGET = 4031.59
375+fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20310
376376
377−fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11194.08
378−fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20312
377+fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11185.65
378+fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20344
379379
380380 $(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s16p,s16le,s16)
381381 $(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s32p,s32le,s16)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t