Use size information from the demuxer, whenever available. i.e. fix WMV3 decoding.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Mon, 3 May 2010 15:29:18 +0000 (15:29 +0000)
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Mon, 20 Sep 2010 10:55:43 +0000 (12:55 +0200)
gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c
gst-libs/gst/vaapi/gstvaapidecoder_priv.h

index 44e99da..c161d09 100644 (file)
@@ -366,6 +366,10 @@ gst_vaapi_decoder_ffmpeg_open(GstVaapiDecoderFfmpeg *ffdecoder, GstBuffer *buffe
         }
     }
 
+    /* Use size information from the demuxer, whenever available */
+    priv->avctx->coded_width  = GST_VAAPI_DECODER_WIDTH(ffdecoder);
+    priv->avctx->coded_height = GST_VAAPI_DECODER_HEIGHT(ffdecoder);
+
     GST_VAAPI_DISPLAY_LOCK(display);
     ret = avcodec_open(priv->avctx, ffcodec);
     GST_VAAPI_DISPLAY_UNLOCK(display);
index 183c499..2b30cf3 100644 (file)
@@ -76,6 +76,28 @@ G_BEGIN_DECLS
 #define GST_VAAPI_DECODER_CODEC_DATA(decoder) \
     GST_VAAPI_DECODER_CAST(decoder)->priv->codec_data
 
+/**
+ * GST_VAAPI_DECODER_WIDTH:
+ * @decoder: a #GstVaapiDecoder
+ *
+ * Macro that evaluates to the coded width of the picture
+ * This is an internal macro that does not do any run-time type check.
+ */
+#undef  GST_VAAPI_DECODER_WIDTH
+#define GST_VAAPI_DECODER_WIDTH(decoder) \
+    GST_VAAPI_DECODER_CAST(decoder)->priv->width
+
+/**
+ * GST_VAAPI_DECODER_HEIGHT:
+ * @decoder: a #GstVaapiDecoder
+ *
+ * Macro that evaluates to the coded height of the picture
+ * This is an internal macro that does not do any run-time type check.
+ */
+#undef  GST_VAAPI_DECODER_HEIGHT
+#define GST_VAAPI_DECODER_HEIGHT(decoder) \
+    GST_VAAPI_DECODER_CAST(decoder)->priv->height
+
 /* End-of-Stream buffer */
 #define GST_BUFFER_FLAG_EOS (GST_BUFFER_FLAG_LAST + 0)