[Libav-user] Reset AVFilterContext* after seeking

Stefano Sabatini stefasab at gmail.com
Mon Jan 21 13:52:59 CET 2013


In data Monday 2013-01-21 15:40:48 +0400, Pavel Sokolov ha scritto:
> 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?

You may need to implement a command called "reset" or such (see
process_command API). Patches/feature requests are welcome.


More information about the Libav-user mailing list