+2008-10-15 Sebastian Dröge <slomo@circular-chaos.org>
+
+ Patch by: Robin Stocker <robin at nibor dot org>
+
+ * ext/ffmpeg/gstffmpegdec.c:
+ (gst_ffmpegdec_add_pixel_aspect_ratio):
+ If both, the decoder and the demuxer, provide a non-1:1 PAR
+ prefer the one of the demuxer instead of the one of the decoder.
+ Fixes bug #556336.
+
2008-10-08 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_vid_caps_new),
/* clean up remaining allocated data */
av_free (ffmpegdec->context);
av_free (ffmpegdec->picture);
-
+
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
}
case CODEC_TYPE_AUDIO:
default:
- GST_ERROR_OBJECT (ffmpegdec, "_get_buffer() should never get called for non-video buffers !");
+ GST_ERROR_OBJECT (ffmpegdec,
+ "_get_buffer() should never get called for non-video buffers !");
g_assert_not_reached ();
break;
}
/* Both the demuxer and the decoder provide a PAR. If one of
* the two PARs is 1:1 and the other one is not, use the one
- * that is not 1:1. If both are non-1:1, use the pixel aspect
- * ratio provided by the codec */
+ * that is not 1:1. */
if (demuxer_num == demuxer_denom && decoder_num != decoder_denom)
goto use_decoder_par;
if (decoder_num == decoder_denom && demuxer_num != demuxer_denom)
goto use_demuxer_par;
- /* fall through and use decoder pixel aspect ratio */
+ /* Both PARs are non-1:1, so use the PAR provided by the demuxer */
+ goto use_demuxer_par;
+
use_decoder_par:
{
GST_DEBUG_OBJECT (ffmpegdec,
* else we might create the first buffer with a very big timestamp gap. */
if (outbuf == NULL && ffmpegdec->discont) {
GST_DEBUG_OBJECT (ffmpegdec, "no buffer but keeping timestamp");
- ffmpegdec->clear_ts = FALSE;
+ ffmpegdec->clear_ts = FALSE;
}
break;
default:
/* there is output, set pointers for next round. */
bsize -= res;
bdata += res;
- }
- else {
- /* Parser did not consume any data, make sure we don't clear the
- * timestamp for the next round */
+ } else {
+ /* Parser did not consume any data, make sure we don't clear the
+ * timestamp for the next round */
ffmpegdec->clear_ts = FALSE;
}
if (ffmpegdec->clear_ts) {
in_timestamp = GST_CLOCK_TIME_NONE;
in_duration = GST_CLOCK_TIME_NONE;
- }
- else {
+ } else {
ffmpegdec->clear_ts = TRUE;
}
goto next;
}
- GST_DEBUG ("Trying plugin %s [%s]", in_plugin->name,
- in_plugin->long_name);
+ GST_DEBUG ("Trying plugin %s [%s]", in_plugin->name, in_plugin->long_name);
/* no codecs for which we're GUARANTEED to have better alternatives */
/* MPEG1VIDEO : the mpeg2video decoder is preferred */
in_plugin->id, FALSE);
}
if (!srccaps) {
- GST_WARNING ("Couldn't get source caps for decoder %s",
- in_plugin->name);
+ GST_WARNING ("Couldn't get source caps for decoder %s", in_plugin->name);
goto next;
}