diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2007-12-13 10:38:23 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2007-12-13 10:38:23 +0000 |
commit | e29787776c4eccfecaecf5ead5c0ec17871037d6 (patch) | |
tree | 1683c41e43ebcec8469223c29489c987a95a0dd8 /gst/videoparse | |
parent | 4878ce90a229d2b337cb2cb8750fed3c95f82104 (diff) | |
download | gst-plugins-bad-e29787776c4eccfecaecf5ead5c0ec17871037d6.tar.gz gst-plugins-bad-e29787776c4eccfecaecf5ead5c0ec17871037d6.tar.bz2 gst-plugins-bad-e29787776c4eccfecaecf5ead5c0ec17871037d6.zip |
gst/videoparse/gstvideoparse.c: Handle -1 values for the CONVERT query too.
Original commit message from CVS:
* gst/videoparse/gstvideoparse.c: (gst_video_parse_convert),
(gst_video_parse_sink_event):
Handle -1 values for the CONVERT query too.
Diffstat (limited to 'gst/videoparse')
-rw-r--r-- | gst/videoparse/gstvideoparse.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gst/videoparse/gstvideoparse.c b/gst/videoparse/gstvideoparse.c index c18cb2e6..139a9cff 100644 --- a/gst/videoparse/gstvideoparse.c +++ b/gst/videoparse/gstvideoparse.c @@ -415,6 +415,13 @@ gst_video_parse_convert (GstVideoParse * vp, if (src_format == dest_format) { *dest_value = src_value; ret = TRUE; + goto done; + } + + if (src_value == -1) { + *dest_value = -1; + ret = TRUE; + goto done; } /* bytes to frames */ @@ -426,12 +433,14 @@ gst_video_parse_convert (GstVideoParse * vp, *dest_value = 0; } ret = TRUE; + goto done; } /* frames to bytes */ if (src_format == GST_FORMAT_DEFAULT && dest_format == GST_FORMAT_BYTES) { *dest_value = gst_util_uint64_scale_int (src_value, vp->blocksize, 1); ret = TRUE; + goto done; } /* time to frames */ @@ -444,6 +453,7 @@ gst_video_parse_convert (GstVideoParse * vp, *dest_value = 0; } ret = TRUE; + goto done; } /* frames to time */ @@ -456,6 +466,7 @@ gst_video_parse_convert (GstVideoParse * vp, *dest_value = 0; } ret = TRUE; + goto done; } /* time to bytes */ @@ -468,6 +479,7 @@ gst_video_parse_convert (GstVideoParse * vp, *dest_value = 0; } ret = TRUE; + goto done; } /* bytes to time */ @@ -482,6 +494,8 @@ gst_video_parse_convert (GstVideoParse * vp, ret = TRUE; } +done: + GST_DEBUG ("ret=%d result %" G_GINT64_FORMAT, ret, *dest_value); return ret; @@ -512,9 +526,7 @@ gst_video_parse_sink_event (GstPad * pad, GstEvent * event) ret = gst_video_parse_convert (vp, format, start, GST_FORMAT_TIME, &start); ret &= gst_video_parse_convert (vp, format, time, GST_FORMAT_TIME, &time); - if (stop != GST_CLOCK_TIME_NONE) - ret &= - gst_video_parse_convert (vp, format, stop, GST_FORMAT_TIME, &stop); + ret &= gst_video_parse_convert (vp, format, stop, GST_FORMAT_TIME, &stop); if (!ret) { GST_ERROR_OBJECT (vp, "Failed converting to GST_FORMAT_TIME format (%d)", format); |