From: Robin Stocker Date: Wed, 15 Oct 2008 11:28:05 +0000 (+0000) Subject: ext/ffmpeg/gstffmpegdec.c: If both, the decoder and the demuxer, provide a non-1... X-Git-Tag: 1.19.3~499^2~1479 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6425e766d6caa4d3e8c9e63d46a67157b66fa0e;p=platform%2Fupstream%2Fgstreamer.git ext/ffmpeg/gstffmpegdec.c: If both, the decoder and the demuxer, provide a non-1:1 PAR prefer the one of the demuxer ... Original commit message from CVS: Patch by: Robin Stocker * 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. --- diff --git a/ChangeLog b/ChangeLog index 21b30db..e4b4dc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-10-15 Sebastian Dröge + + Patch by: Robin Stocker + + * 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 * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_vid_caps_new), diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index bbb81a8..1e4b489 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -364,7 +364,7 @@ gst_ffmpegdec_finalize (GObject * object) /* clean up remaining allocated data */ av_free (ffmpegdec->context); av_free (ffmpegdec->picture); - + } G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -864,7 +864,8 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture) } 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; } @@ -965,15 +966,16 @@ gst_ffmpegdec_add_pixel_aspect_ratio (GstFFMpegDec * ffmpegdec, /* 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, @@ -1863,7 +1865,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * 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: @@ -2214,10 +2216,9 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) /* 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; } @@ -2301,8 +2302,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) if (ffmpegdec->clear_ts) { in_timestamp = GST_CLOCK_TIME_NONE; in_duration = GST_CLOCK_TIME_NONE; - } - else { + } else { ffmpegdec->clear_ts = TRUE; } @@ -2471,8 +2471,7 @@ gst_ffmpegdec_register (GstPlugin * plugin) 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 */ @@ -2501,8 +2500,7 @@ gst_ffmpegdec_register (GstPlugin * plugin) 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; }