Hi, On Mon, Jul 11, 2011 at 3:00 PM, Diego Biurrun <[email protected]> wrote: > On Mon, Jul 11, 2011 at 07:31:26PM +0200, Vladimir Pantelic wrote: >> Diego Biurrun wrote: >>> This fixes some warnings about unused-but-set variables. >>> >>> --- a/ffplay.c >>> +++ b/ffplay.c >>> @@ -1485,9 +1485,8 @@ static int get_video_frame(VideoState *is, AVFrame >>> *frame, int64_t *pts, AVPacke >>> return 0; >>> } >>> >>> - len1 = avcodec_decode_video2(is->video_st->codec, >>> - frame,&got_picture, >>> - pkt); >>> + if (avcodec_decode_video2(is->video_st->codec, frame,&got_picture, >>> pkt)< 0) >>> + return 1; >> >> this does not just fix a warning, it also changes behaviour, no? > > It does, thanks for doublechecking. On second thought I think the > return value from avcodec_decode_video2 can be ignored in this case. > Error checking is done on got_picture in the line below.
got_picture isn't an error check, it's a check to see if the decoder output an image. We don't _do_ any error checking now. Ignoring the return value is probably fine, I mean, decoders can usually simply restart after an error. But then make sure the commit msg is accurate. Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
