Use size information from the demuxer, whenever available. i.e. fix WMV3 decoding.

This commit is contained in:
gb 2010-05-03 15:29:18 +00:00 committed by Gwenole Beauchesne
parent 477e3b8530
commit 4285c2cc02
2 changed files with 26 additions and 0 deletions

View 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);

View 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)