aboutsummaryrefslogtreecommitdiffstats
path: root/avplay.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-04-06 13:51:34 +0300
committerMartin Storsjö <martin@martin.st>2012-04-06 20:49:23 +0300
commit951e715cebfaffced7f13c1525771ff917fe1d38 (patch)
tree209f77fa7c588454c1071a57b14a5a7d809b7db4 /avplay.c
parent20234a4bd7e187ae31f9a66b5c40e98666bc30e4 (diff)
downloadffmpeg-951e715cebfaffced7f13c1525771ff917fe1d38.tar.gz
avplay: Don't try to scale timestamps if the tb isn't set
If get_filtered_video_frame failed above, tb might not be initialized at all, so don't scale using it. This fixes cases where avplay could crash if aborting avformat_find_stream_info with ctrl+c. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'avplay.c')
-rw-r--r--avplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/avplay.c b/avplay.c
index d9c178604f..d1cf53d117 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1796,7 +1796,7 @@ static int video_thread(void *arg)
frame->opaque = picref;
}
- if (av_cmp_q(tb, is->video_st->time_base)) {
+ if (ret >= 0 && av_cmp_q(tb, is->video_st->time_base)) {
av_unused int64_t pts1 = pts_int;
pts_int = av_rescale_q(pts_int, tb, is->video_st->time_base);
av_dlog(NULL, "video_thread(): "