summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWind Yuan <feng.yuan@intel.com>2013-01-11 17:08:00 +0800
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-25 10:48:05 +0100
commitbd57dcb5fc0dbfbc341deedb101887fd3faff62b (patch)
tree37bb3816afa73bb59018cbf214dec82c143c4863
parentcb95e1bb1fd3ddef202585c041aa84c35bf832b1 (diff)
vc1: fix decoding of WMV3 videos in AVI format.
The AVI demuxer (avidemux) does not set a proper "format" attribute to the generated caps. So, try to recover the video codec format from the "wmvversion" property instead. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_vc1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c
index be6149bb..fb72920a 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c
@@ -1128,6 +1128,7 @@ decode_codec_data(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
guint buf_size, ofs;
gint width, height;
guint32 format;
+ gint version;
buf = GST_BUFFER_DATA(buffer);
buf_size = GST_BUFFER_SIZE(buffer);
@@ -1144,6 +1145,12 @@ decode_codec_data(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
}
if (!gst_structure_get_fourcc(structure, "format", &format)) {
+ /* Try to determine format from "wmvversion" property */
+ if (gst_structure_get_int(structure, "wmvversion", &version))
+ format = (version >= 1 && version <= 3) ?
+ GST_MAKE_FOURCC('W','M','V',('0'+version)) : 0;
+ }
+ if (!format) {
GST_ERROR("failed to parse profile from codec-data");
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC;
}