summaryrefslogtreecommitdiffstats
path: root/sys/dshowdecwrapper/gstdshowvideodec.cpp
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-11-21 00:47:37 +0000
committerMichael Smith <msmith@xiph.org>2008-11-21 00:47:37 +0000
commitbba82abbf7edd7b7751af53a817622d13b5ab577 (patch)
tree33e2d6e226358867b9bd9d54fd3fc2cb02eb0d13 /sys/dshowdecwrapper/gstdshowvideodec.cpp
parentda17b1b643fb29e2fb3070a8298224fc6f21ea65 (diff)
downloadgst-plugins-bad-bba82abbf7edd7b7751af53a817622d13b5ab577.tar.gz
gst-plugins-bad-bba82abbf7edd7b7751af53a817622d13b5ab577.tar.bz2
gst-plugins-bad-bba82abbf7edd7b7751af53a817622d13b5ab577.zip
sys/dshowdecwrapper/gstdshowaudiodec.cpp: Fix flushing/seeking problems returning error code.
Original commit message from CVS: * sys/dshowdecwrapper/gstdshowaudiodec.cpp: Fix flushing/seeking problems returning error code. Fix mp3 decoding with winXP (crashed randomly, occasionally). * sys/dshowdecwrapper/gstdshowvideodec.cpp: Fix problems when framerate is missing from video.
Diffstat (limited to 'sys/dshowdecwrapper/gstdshowvideodec.cpp')
-rw-r--r--sys/dshowdecwrapper/gstdshowvideodec.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/sys/dshowdecwrapper/gstdshowvideodec.cpp b/sys/dshowdecwrapper/gstdshowvideodec.cpp
index e16de6f6..600bfa81 100644
--- a/sys/dshowdecwrapper/gstdshowvideodec.cpp
+++ b/sys/dshowdecwrapper/gstdshowvideodec.cpp
@@ -539,13 +539,16 @@ gst_dshowvideodec_sink_setcaps (GstPad * pad, GstCaps * caps)
goto end;
}
fps = gst_structure_get_value (s, "framerate");
- if (!fps) {
- GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,
- ("error getting video framerate from caps"), (NULL));
- goto end;
+ if (fps) {
+ vdec->fps_n = gst_value_get_fraction_numerator (fps);
+ vdec->fps_d = gst_value_get_fraction_denominator (fps);
+ }
+ else {
+ /* Invent a sane default framerate; the timestamps matter
+ * more anyway. */
+ vdec->fps_n = 25;
+ vdec->fps_d = 1;
}
- vdec->fps_n = gst_value_get_fraction_numerator (fps);
- vdec->fps_d = gst_value_get_fraction_denominator (fps);
if ((v = gst_structure_get_value (s, "codec_data")))
extradata = gst_value_get_buffer (v);
@@ -691,8 +694,13 @@ gst_dshowvideodec_sink_setcaps (GstPad * pad, GstCaps * caps)
caps_out = gst_caps_from_string (klass->entry->srccaps);
gst_caps_set_simple (caps_out,
"width", G_TYPE_INT, vdec->width,
- "height", G_TYPE_INT, vdec->height,
- "framerate", GST_TYPE_FRACTION, vdec->fps_n, vdec->fps_d, NULL);
+ "height", G_TYPE_INT, vdec->height, NULL);
+
+ if (vdec->fps_n && vdec->fps_d) {
+ gst_caps_set_simple (caps_out,
+ "framerate", GST_TYPE_FRACTION, vdec->fps_n, vdec->fps_d, NULL);
+ }
+
if (!gst_pad_set_caps (vdec->srcpad, caps_out)) {
gst_caps_unref (caps_out);
GST_ELEMENT_ERROR (vdec, CORE, NEGOTIATION,