Commit 950ad1ab authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

ext/ffmpeg/gstffmpegdec.c: Initialize hurry_up to 0 to fix "might be used...

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.
parent 15c2ba23
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> 2008-01-25 Wim Taymans <wim.taymans@collabora.co.uk>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init), * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init),
......
...@@ -660,8 +660,7 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps) ...@@ -660,8 +660,7 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
GST_DEBUG_OBJECT (ffmpegdec, "direct rendering setup for H264"); GST_DEBUG_OBJECT (ffmpegdec, "direct rendering setup for H264");
ffmpegdec->current_dr = TRUE; ffmpegdec->current_dr = TRUE;
ffmpegdec->extra_ref = TRUE; ffmpegdec->extra_ref = TRUE;
} } else {
else {
GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering"); GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
/* do *not* draw edges when in direct rendering, for some reason it draws /* do *not* draw edges when in direct rendering, for some reason it draws
* outside of the memory. */ * outside of the memory. */
...@@ -772,7 +771,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture) ...@@ -772,7 +771,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
ffmpegdec = (GstFFMpegDec *) context->opaque; 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); ffmpegdec->in_ts);
/* apply the last timestamp we have seen to this picture, when we get the /* 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) ...@@ -806,7 +805,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
clip_height = height; clip_height = height;
/* this is the size ffmpeg needs for the buffer */ /* 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", GST_LOG_OBJECT (ffmpegdec, "aligned outsize %d/%d, clip %d/%d",
width, height, clip_width, clip_height); width, height, clip_width, clip_height);
...@@ -839,7 +838,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture) ...@@ -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 /* tell ffmpeg we own this buffer, tranfer the ref we have on the buffer to
* the opaque data. */ * the opaque data. */
picture->type = FF_BUFFER_TYPE_USER; picture->type = FF_BUFFER_TYPE_USER;
picture->age = 256*256*256*64; picture->age = 256 * 256 * 256 * 64;
picture->opaque = buf; picture->opaque = buf;
#ifdef EXTRA_REF #ifdef EXTRA_REF
...@@ -1322,7 +1321,7 @@ alloc_failed: ...@@ -1322,7 +1321,7 @@ alloc_failed:
} }
static void static void
clear_queued (GstFFMpegDec *ffmpegdec) clear_queued (GstFFMpegDec * ffmpegdec)
{ {
g_list_foreach (ffmpegdec->queued, (GFunc) gst_mini_object_unref, NULL); g_list_foreach (ffmpegdec->queued, (GFunc) gst_mini_object_unref, NULL);
g_list_free (ffmpegdec->queued); g_list_free (ffmpegdec->queued);
...@@ -1330,7 +1329,7 @@ clear_queued (GstFFMpegDec *ffmpegdec) ...@@ -1330,7 +1329,7 @@ clear_queued (GstFFMpegDec *ffmpegdec)
} }
static GstFlowReturn static GstFlowReturn
flush_queued (GstFFMpegDec *ffmpegdec) flush_queued (GstFFMpegDec * ffmpegdec)
{ {
GstFlowReturn res = GST_FLOW_OK; GstFlowReturn res = GST_FLOW_OK;
...@@ -1345,7 +1344,8 @@ flush_queued (GstFFMpegDec *ffmpegdec) ...@@ -1345,7 +1344,8 @@ flush_queued (GstFFMpegDec *ffmpegdec)
/* iterate ouput queue an push downstream */ /* iterate ouput queue an push downstream */
res = gst_pad_push (ffmpegdec->srcpad, buf); 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; return res;
} }
...@@ -1373,7 +1373,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec, ...@@ -1373,7 +1373,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
gboolean iskeyframe; gboolean iskeyframe;
gboolean mode_switch; gboolean mode_switch;
gboolean decode; gboolean decode;
gint hurry_up; gint hurry_up = 0;
*ret = GST_FLOW_OK; *ret = GST_FLOW_OK;
*outbuf = NULL; *outbuf = NULL;
...@@ -1469,7 +1469,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec, ...@@ -1469,7 +1469,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
if (ffmpegdec->picture->pts != -1) { if (ffmpegdec->picture->pts != -1) {
GST_LOG_OBJECT (ffmpegdec, "using timestamp returned by ffmpeg"); GST_LOG_OBJECT (ffmpegdec, "using timestamp returned by ffmpeg");
/* Get (interpolated) timestamp from 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)) { if (!GST_CLOCK_TIME_IS_VALID (in_timestamp)) {
in_timestamp = ffmpegdec->next_ts; in_timestamp = ffmpegdec->next_ts;
...@@ -1807,8 +1807,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, ...@@ -1807,8 +1807,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
if (ffmpegdec->segment.rate > 0.0) { if (ffmpegdec->segment.rate > 0.0) {
/* and off we go */ /* and off we go */
*ret = gst_pad_push (ffmpegdec->srcpad, outbuf); *ret = gst_pad_push (ffmpegdec->srcpad, outbuf);
} } else {
else {
/* reverse playback, queue frame till later */ /* reverse playback, queue frame till later */
GST_DEBUG_OBJECT (ffmpegdec, "queued frame"); GST_DEBUG_OBJECT (ffmpegdec, "queued frame");
ffmpegdec->queued = g_list_prepend (ffmpegdec->queued, outbuf); ffmpegdec->queued = g_list_prepend (ffmpegdec->queued, outbuf);
...@@ -2124,7 +2123,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) ...@@ -2124,7 +2123,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
/* add padding */ /* add padding */
if (ffmpegdec->padded_size <= size + FF_INPUT_BUFFER_PADDING_SIZE) { if (ffmpegdec->padded_size <= size + FF_INPUT_BUFFER_PADDING_SIZE) {
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", GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
ffmpegdec->padded_size); ffmpegdec->padded_size);
} }
...@@ -2132,8 +2132,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) ...@@ -2132,8 +2132,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
memset (ffmpegdec->padded + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); memset (ffmpegdec->padded + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
pdata = ffmpegdec->padded; pdata = ffmpegdec->padded;
} } else {
else {
pdata = data; pdata = data;
} }
...@@ -2157,8 +2156,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) ...@@ -2157,8 +2156,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
* data we tried. */ * data we tried. */
GST_LOG_OBJECT (ffmpegdec, "Decoding didn't return any data, breaking"); GST_LOG_OBJECT (ffmpegdec, "Decoding didn't return any data, breaking");
break; break;
} } else if (len < 0) {
else if (len < 0) {
/* a decoding error happened, we must break and try again with next data. */ /* a decoding error happened, we must break and try again with next data. */
GST_LOG_OBJECT (ffmpegdec, "Decoding error, breaking"); GST_LOG_OBJECT (ffmpegdec, "Decoding error, breaking");
bsize = 0; bsize = 0;
...@@ -2168,15 +2166,14 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) ...@@ -2168,15 +2166,14 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
* already when using the parser. */ * already when using the parser. */
bsize -= len; bsize -= len;
bdata += len; bdata += len;
} } else {
else {
if (len == 0) { if (len == 0) {
/* nothing was decoded, this could be because no data was available or /* nothing was decoded, this could be because no data was available or
* because we were skipping frames. Since we have a parser we can * because we were skipping frames. Since we have a parser we can
* continue with the next frame */ * continue with the next frame */
GST_LOG_OBJECT (ffmpegdec, "Decoding didn't return any data, trying next"); GST_LOG_OBJECT (ffmpegdec,
} "Decoding didn't return any data, trying next");
else if (len < 0) { } else if (len < 0) {
/* we have a context that will bring us to the next frame */ /* we have a context that will bring us to the next frame */
GST_LOG_OBJECT (ffmpegdec, "Decoding error, trying next"); GST_LOG_OBJECT (ffmpegdec, "Decoding error, trying next");
} }
......
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