mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
[846/906] mixer: handle 0/1 framerate better in caps
This commit is contained in:
parent
78a726ebc1
commit
5cb409218a
1 changed files with 4 additions and 4 deletions
|
@ -135,7 +135,7 @@ gst_gl_mixer_update_src_caps (GstGLMixer * mix)
|
||||||
width = GST_VIDEO_INFO_WIDTH (&mpad->in_info);
|
width = GST_VIDEO_INFO_WIDTH (&mpad->in_info);
|
||||||
height = GST_VIDEO_INFO_HEIGHT (&mpad->in_info);
|
height = GST_VIDEO_INFO_HEIGHT (&mpad->in_info);
|
||||||
|
|
||||||
if (fps_n == 0 || fps_d == 0 || width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
this_width = width;
|
this_width = width;
|
||||||
|
@ -158,13 +158,13 @@ gst_gl_mixer_update_src_caps (GstGLMixer * mix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (best_fps_n <= 0 && best_fps_d <= 0) {
|
if (best_fps_n == 0 || (best_fps_n < 0 && best_fps_d <= 0)) {
|
||||||
best_fps_n = 25;
|
best_fps_n = 25;
|
||||||
best_fps_d = 1;
|
best_fps_d = 1;
|
||||||
best_fps = 25.0;
|
best_fps = 25.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (best_width > 0 && best_height > 0 && best_fps > 0) {
|
if (best_width > 0 && best_height > 0 && best_fps > 0.0) {
|
||||||
GstCaps *caps, *peercaps;
|
GstCaps *caps, *peercaps;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
@ -209,7 +209,7 @@ gst_gl_mixer_update_src_caps (GstGLMixer * mix)
|
||||||
GST_GL_MIXER_UNLOCK (mix);
|
GST_GL_MIXER_UNLOCK (mix);
|
||||||
ret = gst_gl_mixer_src_setcaps (mix->srcpad, mix, caps);
|
ret = gst_gl_mixer_src_setcaps (mix->srcpad, mix, caps);
|
||||||
} else {
|
} else {
|
||||||
GST_INFO_OBJECT (mix, "Invalid caps");
|
GST_ERROR_OBJECT (mix, "Invalid caps");
|
||||||
GST_GL_MIXER_UNLOCK (mix);
|
GST_GL_MIXER_UNLOCK (mix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue