From 2c3e7b635279209a119c080ae4b40e599b009d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Zanelli?= Date: Mon, 19 May 2014 17:52:38 +0200 Subject: [PATCH] h264parse: use new gst_h264_video_calculate_framerate() to get framerate https://bugzilla.gnome.org/show_bug.cgi?id=723352 --- gst/videoparsers/gsth264parse.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index ac499e0504..2b43b301d9 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1173,6 +1173,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) caps = gst_caps_copy (sink_caps); } else { gint crop_width, crop_height; + gint fps_num, fps_den; if (sps->frame_cropping_flag) { crop_width = sps->crop_rect_width; @@ -1193,12 +1194,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) /* 0/1 is set as the default in the codec parser, we will set * it in case we have no info */ - if (G_UNLIKELY (h264parse->fps_num != sps->fps_num - || h264parse->fps_den != sps->fps_den)) { - GST_DEBUG_OBJECT (h264parse, "framerate changed %d/%d", - sps->fps_num, sps->fps_den); - h264parse->fps_num = sps->fps_num; - h264parse->fps_den = sps->fps_den; + gst_h264_video_calculate_framerate (sps, h264parse->field_pic_flag, + h264parse->sei_pic_struct, &fps_num, &fps_den); + if (G_UNLIKELY (h264parse->fps_num != fps_num + || h264parse->fps_den != fps_den)) { + GST_DEBUG_OBJECT (h264parse, "framerate changed %d/%d", fps_num, fps_den); + h264parse->fps_num = fps_num; + h264parse->fps_den = fps_den; modified = TRUE; } @@ -1213,11 +1215,12 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) } if (G_UNLIKELY (modified || h264parse->update_caps)) { - gint fps_num = h264parse->fps_num; - gint fps_den = h264parse->fps_den; gint width, height; GstClockTime latency; + fps_num = h264parse->fps_num; + fps_den = h264parse->fps_den; + caps = gst_caps_copy (sink_caps); /* sps should give this but upstream overrides */