Index: oggenc/oggenc.c =================================================================== --- oggenc/oggenc.c (revision 14552) +++ oggenc/oggenc.c (working copy) @@ -147,6 +151,7 @@ char *artist=NULL, *album=NULL, *title=NULL, *track=NULL; char *date=NULL, *genre=NULL; input_format *format; + int resampled = 0; /* Set various encoding defaults */ @@ -324,6 +329,8 @@ if(opt.resamplefreq && opt.resamplefreq != enc_opts.rate) { int fromrate = enc_opts.rate; + + resampled = 1; enc_opts.resamplefreq = opt.resamplefreq; if(setup_resample(&enc_opts)) { errors++; @@ -369,7 +376,7 @@ clear_scaler(&enc_opts); if(opt.downmix) clear_downmix(&enc_opts); - if(opt.resamplefreq && opt.resamplefreq != enc_opts.rate) + if(resampled) clear_resample(&enc_opts); clear_all: