Commit 595217e8 authored by Jens Granseuer's avatar Jens Granseuer Committed by Tim-Philipp Müller
Browse files

Declare variables at the beginning of a block. Fixes #383195.

Original commit message from CVS:
Patch by: Jens Granseuer <jensgr at gmx net>
* gst-libs/gst/cdda/gstcddabasesrc.c: (gst_cdda_base_src_create):
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer):
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_fixate):
Declare variables at the beginning of a block. Fixes #383195.
parent 8e8f88c1
2006-12-09 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Jens Granseuer <jensgr at gmx net>
* gst-libs/gst/cdda/gstcddabasesrc.c: (gst_cdda_base_src_create):
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer):
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_fixate):
Declare variables at the beginning of a block. Fixes #383195.
2006-12-07 Jan Schmidt <thaytan@mad.scientist.com>
 
* configure.ac:
......@@ -1548,10 +1548,10 @@ gst_cdda_base_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
format = GST_FORMAT_TIME;
if (gst_pad_query_position (GST_BASE_SRC_PAD (src), &format, &qry_position)) {
position = (GstClockTime) qry_position;
gint64 next_ts = 0;
position = (GstClockTime) qry_position;
++src->cur_sector;
if (gst_pad_query_position (GST_BASE_SRC_PAD (src), &format, &next_ts)) {
duration = (GstClockTime) (next_ts - qry_position);
......
......@@ -322,6 +322,8 @@ gst_base_rtp_audio_payload_handle_frame_based_buffer (GstBaseRTPPayload *
/* as long as we have full frames */
/* this loop will push all available buffers till the last frame */
while (available >= frame_size) {
gfloat ts_inc;
/* we need to see how many frames we can get based on maximum MTU, maximum
* ptime and the number of bytes available */
payload_len = MIN (MIN (
......@@ -336,7 +338,7 @@ gst_base_rtp_audio_payload_handle_frame_based_buffer (GstBaseRTPPayload *
ret = gst_base_rtp_audio_payload_push (basepayload, data, payload_len,
basertpaudiopayload->base_ts);
gfloat ts_inc = (payload_len * frame_duration) / frame_size;
ts_inc = (payload_len * frame_duration) / frame_size;
ts_inc = ts_inc * GST_MSECOND;
basertpaudiopayload->base_ts += ts_inc;
......@@ -414,6 +416,8 @@ gst_base_rtp_audio_payload_handle_sample_based_buffer (GstBaseRTPPayload *
/* as long as we have full frames */
/* this loop will use all available data until the last byte */
while (available) {
gfloat num, datarate;
/* we need to see how many frames we can get based on maximum MTU, maximum
* ptime and the number of bytes available */
payload_len = MIN (MIN (
......@@ -428,8 +432,8 @@ gst_base_rtp_audio_payload_handle_sample_based_buffer (GstBaseRTPPayload *
ret = gst_base_rtp_audio_payload_push (basepayload, data, payload_len,
basertpaudiopayload->base_ts);
gfloat num = payload_len;
gfloat datarate = (sample_size * basepayload->clock_rate);
num = payload_len;
datarate = (sample_size * basepayload->clock_rate);
basertpaudiopayload->base_ts +=
/* payload_len (bytes) * nsecs/sec / datarate (bytes*sec) */
......
......@@ -231,9 +231,9 @@ gst_v4lsrc_fixate (GstPad * pad, GstCaps * caps)
GST_DEBUG_OBJECT (v4lsrc, "targetting %dx%d", targetwidth, targetheight);
for (i = 0; i < gst_caps_get_size (caps); ++i) {
structure = gst_caps_get_structure (caps, i);
const GValue *v;
structure = gst_caps_get_structure (caps, i);
gst_structure_fixate_field_nearest_int (structure, "width", targetwidth);
gst_structure_fixate_field_nearest_int (structure, "height", targetheight);
gst_structure_fixate_field_nearest_fraction (structure, "framerate", 15, 2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment