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
752}752}
753 753
754int swr_drop_output(struct SwrContext *s, int count){754int swr_drop_output(struct SwrContext *s, int count){
755 const uint8_t *tmp_arg[SWR_CH_MAX];
755 s->drop_output += count;756 s->drop_output += count;
756 757
757 if(s->drop_output <= 0)758 if(s->drop_output <= 0)
758 return 0;759 return 0;
759 760
760 av_log(s, AV_LOG_VERBOSE, "discarding %d audio samples\n", count);761 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);
762}763}
763 764
764int swr_inject_silence(struct SwrContext *s, int count){765int 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
365fate-swr-resample_async-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav365fate-swr-resample_async-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav
366endef366endef
367 367
368fate-swr-resample_async-fltp-44100-8000: CMP_TARGET = 4047.25368fate-swr-resample_async-fltp-44100-8000: CMP_TARGET = 4031.60
369fate-swr-resample_async-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20132369fate-swr-resample_async-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20310
370 370
371fate-swr-resample_async-fltp-8000-44100: CMP_TARGET = 11193.77371fate-swr-resample_async-fltp-8000-44100: CMP_TARGET = 11185.34
372fate-swr-resample_async-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20312372fate-swr-resample_async-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20344
373 373
374fate-swr-resample_async-s16p-44100-8000: CMP_TARGET = 4047.24374fate-swr-resample_async-s16p-44100-8000: CMP_TARGET = 4031.59
375fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20132375fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20310
376 376
377fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11194.08377fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11185.65
378fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20312378fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20344
379 379
380$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s16p,s16le,s16)380$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s16p,s16le,s16)
381$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s32p,s32le,s16)381$(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