[Libav-user] Reset AVFilterContext* after seeking

Pavel Sokolov pavel at sokolov.me
Mon Jan 21 12:40:48 CET 2013


Hi!

I have filter: asetnsamples=n=320

I need to reset AVFilterContext* after seeking.

Now i'm doing it like this:

     AVFilterBufferRef *ref = NULL;
     while (true){
       int ret = av_buffersink_get_buffer_ref(_sinkFilter, &ref, 0);
       if (ret >= 0){
         avfilter_unref_buffer(ref);
       } else {
         break;
       }
     }

But there is some problem. Filter stores PTS inside it  and next 
av_buffersink_get_buffer_ref() will return buffer with old PTS value.

How to properly reset filter?


More information about the Libav-user mailing list