ffplay: stats: do not dereference NULL video
authorNicolas George <nicolas.george@normalesup.org>
Tue, 8 Feb 2011 10:57:08 +0000 (11:57 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Fri, 11 Feb 2011 17:59:52 +0000 (18:59 +0100)
Also: cosmetic: split this overly long line

ffplay.c

index ba7e48c..3dcca98 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1284,7 +1284,14 @@ retry:
             if (is->audio_st && is->video_st)
                 av_diff = get_audio_clock(is) - get_video_clock(is);
             printf("%7.2f A-V:%7.3f s:%3.1f aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64"   \r",
-                   get_master_clock(is), av_diff, FFMAX(is->skip_frames-1, 0), aqsize / 1024, vqsize / 1024, sqsize, is->video_st->codec->pts_correction_num_faulty_dts, is->video_st->codec->pts_correction_num_faulty_pts);
+                   get_master_clock(is),
+                   av_diff,
+                   FFMAX(is->skip_frames-1, 0),
+                   aqsize / 1024,
+                   vqsize / 1024,
+                   sqsize,
+                   is->video_st ? is->video_st->codec->pts_correction_num_faulty_dts : 0,
+                   is->video_st ? is->video_st->codec->pts_correction_num_faulty_pts : 0);
             fflush(stdout);
             last_time = cur_time;
         }