summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 5460d20fd1..c8463d5c34 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -389,7 +389,7 @@ static void uninit(sh_video_t *sh){
vd_ffmpeg_ctx *ctx = sh->context;
AVCodecContext *avctx = ctx->avctx;
- if(sh->opts->lavc_param.vstats){
+ if (sh->opts->lavc_param.vstats && avctx->coded_frame) {
int i;
for(i=1; i<32; i++){
mp_msg(MSGT_DECVIDEO, MSGL_INFO, "QP: %d, count: %d\n", i, ctx->qp_stat[i]);
@@ -784,6 +784,9 @@ static struct mp_image *decode(struct sh_video *sh, void *data, int len,
AVFrame *pic= avctx->coded_frame;
double quality=0.0;
+ if (!pic)
+ break;
+
if(!fvstats) {
time_t today2;
struct tm *today;