mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
ext/ffmpeg/gstffmpegdec.c: Initialize hurry_up to 0 to fix "might be used uninitialized" compiler warning.
Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_video_frame): Initialize hurry_up to 0 to fix "might be used uninitialized" compiler warning.
This commit is contained in:
parent
15c2ba23c6
commit
950ad1abbe
2 changed files with 39 additions and 36 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-01-26 Sebastian Dröge <slomo@circular-chaos.org>
|
||||
|
||||
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_video_frame):
|
||||
Initialize hurry_up to 0 to fix "might be used uninitialized"
|
||||
compiler warning.
|
||||
|
||||
2008-01-25 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init),
|
||||
|
|
|
@ -660,8 +660,7 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
|
|||
GST_DEBUG_OBJECT (ffmpegdec, "direct rendering setup for H264");
|
||||
ffmpegdec->current_dr = TRUE;
|
||||
ffmpegdec->extra_ref = TRUE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
|
||||
/* do *not* draw edges when in direct rendering, for some reason it draws
|
||||
* outside of the memory. */
|
||||
|
@ -772,7 +771,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
|||
|
||||
ffmpegdec = (GstFFMpegDec *) context->opaque;
|
||||
|
||||
GST_DEBUG_OBJECT (ffmpegdec, "getting buffer, apply pts %"G_GINT64_FORMAT,
|
||||
GST_DEBUG_OBJECT (ffmpegdec, "getting buffer, apply pts %" G_GINT64_FORMAT,
|
||||
ffmpegdec->in_ts);
|
||||
|
||||
/* apply the last timestamp we have seen to this picture, when we get the
|
||||
|
@ -806,7 +805,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
|||
clip_height = height;
|
||||
|
||||
/* this is the size ffmpeg needs for the buffer */
|
||||
avcodec_align_dimensions(context, &width, &height);
|
||||
avcodec_align_dimensions (context, &width, &height);
|
||||
|
||||
GST_LOG_OBJECT (ffmpegdec, "aligned outsize %d/%d, clip %d/%d",
|
||||
width, height, clip_width, clip_height);
|
||||
|
@ -839,7 +838,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
|||
/* tell ffmpeg we own this buffer, tranfer the ref we have on the buffer to
|
||||
* the opaque data. */
|
||||
picture->type = FF_BUFFER_TYPE_USER;
|
||||
picture->age = 256*256*256*64;
|
||||
picture->age = 256 * 256 * 256 * 64;
|
||||
picture->opaque = buf;
|
||||
|
||||
#ifdef EXTRA_REF
|
||||
|
@ -1322,7 +1321,7 @@ alloc_failed:
|
|||
}
|
||||
|
||||
static void
|
||||
clear_queued (GstFFMpegDec *ffmpegdec)
|
||||
clear_queued (GstFFMpegDec * ffmpegdec)
|
||||
{
|
||||
g_list_foreach (ffmpegdec->queued, (GFunc) gst_mini_object_unref, NULL);
|
||||
g_list_free (ffmpegdec->queued);
|
||||
|
@ -1330,7 +1329,7 @@ clear_queued (GstFFMpegDec *ffmpegdec)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
flush_queued (GstFFMpegDec *ffmpegdec)
|
||||
flush_queued (GstFFMpegDec * ffmpegdec)
|
||||
{
|
||||
GstFlowReturn res = GST_FLOW_OK;
|
||||
|
||||
|
@ -1345,7 +1344,8 @@ flush_queued (GstFFMpegDec *ffmpegdec)
|
|||
/* iterate ouput queue an push downstream */
|
||||
res = gst_pad_push (ffmpegdec->srcpad, buf);
|
||||
|
||||
ffmpegdec->queued = g_list_delete_link (ffmpegdec->queued, ffmpegdec->queued);
|
||||
ffmpegdec->queued =
|
||||
g_list_delete_link (ffmpegdec->queued, ffmpegdec->queued);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -1373,7 +1373,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
|
|||
gboolean iskeyframe;
|
||||
gboolean mode_switch;
|
||||
gboolean decode;
|
||||
gint hurry_up;
|
||||
gint hurry_up = 0;
|
||||
|
||||
*ret = GST_FLOW_OK;
|
||||
*outbuf = NULL;
|
||||
|
@ -1469,7 +1469,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
|
|||
if (ffmpegdec->picture->pts != -1) {
|
||||
GST_LOG_OBJECT (ffmpegdec, "using timestamp returned by ffmpeg");
|
||||
/* Get (interpolated) timestamp from FFMPEG */
|
||||
in_timestamp = (GstClockTime)ffmpegdec->picture->pts;
|
||||
in_timestamp = (GstClockTime) ffmpegdec->picture->pts;
|
||||
}
|
||||
if (!GST_CLOCK_TIME_IS_VALID (in_timestamp)) {
|
||||
in_timestamp = ffmpegdec->next_ts;
|
||||
|
@ -1807,8 +1807,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
|
|||
if (ffmpegdec->segment.rate > 0.0) {
|
||||
/* and off we go */
|
||||
*ret = gst_pad_push (ffmpegdec->srcpad, outbuf);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* reverse playback, queue frame till later */
|
||||
GST_DEBUG_OBJECT (ffmpegdec, "queued frame");
|
||||
ffmpegdec->queued = g_list_prepend (ffmpegdec->queued, outbuf);
|
||||
|
@ -2124,7 +2123,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
|
|||
/* add padding */
|
||||
if (ffmpegdec->padded_size <= size + FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||
ffmpegdec->padded_size = size + FF_INPUT_BUFFER_PADDING_SIZE;
|
||||
ffmpegdec->padded = g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
|
||||
ffmpegdec->padded =
|
||||
g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
|
||||
GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
|
||||
ffmpegdec->padded_size);
|
||||
}
|
||||
|
@ -2132,8 +2132,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
|
|||
memset (ffmpegdec->padded + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
pdata = ffmpegdec->padded;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pdata = data;
|
||||
}
|
||||
|
||||
|
@ -2157,8 +2156,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
|
|||
* data we tried. */
|
||||
GST_LOG_OBJECT (ffmpegdec, "Decoding didn't return any data, breaking");
|
||||
break;
|
||||
}
|
||||
else if (len < 0) {
|
||||
} else if (len < 0) {
|
||||
/* a decoding error happened, we must break and try again with next data. */
|
||||
GST_LOG_OBJECT (ffmpegdec, "Decoding error, breaking");
|
||||
bsize = 0;
|
||||
|
@ -2168,15 +2166,14 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
|
|||
* already when using the parser. */
|
||||
bsize -= len;
|
||||
bdata += len;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (len == 0) {
|
||||
/* nothing was decoded, this could be because no data was available or
|
||||
* because we were skipping frames. Since we have a parser we can
|
||||
* continue with the next frame */
|
||||
GST_LOG_OBJECT (ffmpegdec, "Decoding didn't return any data, trying next");
|
||||
}
|
||||
else if (len < 0) {
|
||||
GST_LOG_OBJECT (ffmpegdec,
|
||||
"Decoding didn't return any data, trying next");
|
||||
} else if (len < 0) {
|
||||
/* we have a context that will bring us to the next frame */
|
||||
GST_LOG_OBJECT (ffmpegdec, "Decoding error, trying next");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue