diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-17 12:07:43 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-17 12:07:43 +0100 |
commit | 206f8fd36fe120beb8358ea2cf1e8164fe661df3 (patch) | |
tree | 87f62e1ae53070497064163a51aa740762e7820f /src | |
parent | d8773bd96bf1d9e00fcc15bcf551e810b26a7378 (diff) | |
download | advtime-206f8fd36fe120beb8358ea2cf1e8164fe661df3.tar.gz advtime-206f8fd36fe120beb8358ea2cf1e8164fe661df3.tar.bz2 advtime-206f8fd36fe120beb8358ea2cf1e8164fe661df3.zip |
video_decode: Use av_strerror to get an error message if read_frame fails
Diffstat (limited to 'src')
-rw-r--r-- | src/video_decode.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/video_decode.c b/src/video_decode.c index 1124d72..b3c8e4d 100644 --- a/src/video_decode.c +++ b/src/video_decode.c @@ -5,6 +5,7 @@ #include "video_decode.h" #include <libavutil/avutil.h> +#include <libavutil/error.h> #include <libavformat/avformat.h> #include <libavcodec/avcodec.h> #include <libswscale/swscale.h> @@ -114,10 +115,16 @@ video_decode_get_frame(struct video_decode *vd, struct video_frame **frame) av_free_packet(&packet); ret = av_read_frame(vd->fmt_ctx, &packet); if (ret < 0) { - if (ret == AVERROR_EOF) + if (ret == AVERROR_EOF) { return 0; + } #if DEBUG - fprintf(stderr, "Found no video stream packet!\n"); + else { + char buf[BUFSIZ]; + av_strerror(ret, buf, BUFSIZ); + fprintf(stderr, + "Failed to read frame: %s\n", buf); + } #endif return -1; } |