[FFmpeg-devel] [PATCH] ffmpeg: handle the case when get_filtered_frame() fails

Michael Niedermayer michaelni at gmx.at
Fri May 20 02:38:26 CEST 2011


On Fri, May 20, 2011 at 01:02:26AM +0200, Stefano Sabatini wrote:
> ---
>  ffmpeg.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index fb644ad..b6ee7e3 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -1690,7 +1690,8 @@ static int output_packet(AVInputStream *ist, int ist_index,
>                  while (frame_available) {
>                      AVRational ist_pts_tb;
>                      if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ost->output_video_filter)
> -                        get_filtered_video_frame(ost->output_video_filter, &picture, &ost->picref, &ist_pts_tb);
> +                        if (get_filtered_video_frame(ost->output_video_filter, &picture, &ost->picref, &ist_pts_tb) < 0)
> +                            goto cont;
>                      if (ost->picref)

Can you elaborate when such failure happens ?
frame_available inplicates poll_frame() so request shouldnt fail i
think

the patch is probably ok but i dont understand whne this happens, maybe
a error message should be printed but then maybe not ....

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110520/b4cb245e/attachment.asc>


More information about the ffmpeg-devel mailing list