diff options
author | Johan Dahlin <johan@gnome.org> | 2004-03-23 16:59:59 +0000 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2004-03-23 16:59:59 +0000 |
commit | 58719f492b13db9ea61a3bcbbc72be5e48d9ab53 (patch) | |
tree | 97f816ccb7129753e7224b12a93310223f4b8175 /gst-libs | |
parent | 5168e399ba6d7b2b5c3b455ea95fe86e492cb7dc (diff) | |
download | gst-plugins-bad-58719f492b13db9ea61a3bcbbc72be5e48d9ab53.tar.gz gst-plugins-bad-58719f492b13db9ea61a3bcbbc72be5e48d9ab53.tar.bz2 gst-plugins-bad-58719f492b13db9ea61a3bcbbc72be5e48d9ab53.zip |
gst-libs/gst/play/play.c (gst_play_audio_fixate)
Original commit message from CVS:
* gst-libs/gst/play/play.c (gst_play_audio_fixate)
(gst_play_video_fixate): Check so the structure has the field
before trying to fixate them, this makes it possible to have
fakesinks for video and audio output without printing errors on
the output console.
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/play/play.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c index 28acb075..74162349 100644 --- a/gst-libs/gst/play/play.c +++ b/gst-libs/gst/play/play.c @@ -480,13 +480,16 @@ gst_play_video_fixate (GstPad * pad, const GstCaps * caps, gpointer user_data) newcaps = gst_caps_copy (caps); structure = gst_caps_get_structure (newcaps, 0); - if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) { + if (gst_structure_has_field (structure, "width") && + gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) { return newcaps; } - if (gst_caps_structure_fixate_field_nearest_int (structure, "height", 240)) { + if (gst_structure_has_field (structure, "height") && + gst_caps_structure_fixate_field_nearest_int (structure, "height", 240)) { return newcaps; } - if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate", + if (gst_structure_has_field (structure, "framerate") && + gst_caps_structure_fixate_field_nearest_double (structure, "framerate", 30.0)) { return newcaps; } @@ -509,16 +512,20 @@ gst_play_audio_fixate (GstPad * pad, const GstCaps * caps, gpointer user_data) NULL); structure = gst_caps_get_structure (newcaps, 0); - if (gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100)) { + if (gst_structure_has_field (structure, "rate") && + gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100)) { return newcaps; } - if (gst_caps_structure_fixate_field_nearest_int (structure, "depth", 16)) { + if (gst_structure_has_field (structure, "depth") && + gst_caps_structure_fixate_field_nearest_int (structure, "depth", 16)) { return newcaps; } - if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 16)) { + if (gst_structure_has_field (structure, "width") && + gst_caps_structure_fixate_field_nearest_int (structure, "width", 16)) { return newcaps; } - if (gst_caps_structure_fixate_field_nearest_int (structure, "channels", 2)) { + if (gst_structure_has_field (structure, "channels") && + gst_caps_structure_fixate_field_nearest_int (structure, "channels", 2)) { return newcaps; } |