summaryrefslogtreecommitdiff
path: root/src/video_decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_decode.c')
-rw-r--r--src/video_decode.c11
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;
}