[FFmpeg-trac] #5785(swresample:new): swr_drop_output misbehaviour

FFmpeg trac at avcodec.org
Fri Aug 19 20:49:49 EEST 2016


#5785: swr_drop_output misbehaviour
------------------------------------+--------------------------------------
             Reporter:  richardpl   |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  swresample
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+--------------------------------------

Comment (by michael):

 If you want to bring the state back to the initial state calling
 swr_close() and swr_init() should do that efficiently, this will not
 reinitialize the resampler

 you can drop output samples too but this will not return to exactly the
 initial state in general.

 swr_drop_output(swr_ctx,swr_get_out_samples(swr_ctx, 0));
 would drop all the old data, but when new data comes in the buffers will
 get filled before output comes out, so this will result in an apparent
 loss of a few audio samples

 you can also resample into a dummy buffer and throw that away which will
 look correct but is possibly not what you actually want because old data
 remains in the buffer and will be output

 If theres some variant missing or can be improved, please say so

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5785#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list