[FFmpeg-devel] [PATCH] movie: set pkt->stream_index for flushing.

Stefano Sabatini stefasab at gmail.com
Thu Aug 16 16:07:58 CEST 2012


Nit on the patch name:
lavfi/movie: set pkt->stream_index for flushing

useful for log grepping purposes.

On date Tuesday 2012-08-14 11:16:51 +0200, Nicolas George encoded:
> Otherwise, the value is kept from the last read,

which value, what is intended by "last read"?

> which is not necessarily the stream that needs flushing.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/src_movie.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
> index 09dfe5d..4ec80b7 100644
> --- a/libavfilter/src_movie.c
> +++ b/libavfilter/src_movie.c
> @@ -498,6 +498,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
>                  }
>                  return AVERROR_EOF;
>              }
> +            pkt->stream_index = movie->st[out_id].st->index;
>              /* packet is already ready for flushing */

Should be fine but I'm having an hard time at understanding the
movie_push_frame() logic with regards to the movie->pkt field
(documenting the out_id parameter may also help).

An alternative would be to create a pkt_stream_idx separate variable
and use it in:

    pkt_out_id = pkt->stream_index > movie->max_stream_index ? -1 :
                 movie->out_index[pkt->stream_index];

[...]
-- 
FFmpeg = Freak and Foolish Minimal Picky Erroneous Gargoyle


More information about the ffmpeg-devel mailing list