diff options
author | Alessandro Decina <alessandro.decina@collabora.co.uk> | 2011-09-26 18:01:04 +0200 |
---|---|---|
committer | Alessandro Decina <alessandro.decina@collabora.co.uk> | 2011-09-26 18:10:42 +0200 |
commit | 715be6037e33571097037368fb3e9a143727962c (patch) | |
tree | 3a9167f494d5db8fa22e3100aea0550589c2d43a /src | |
parent | f809a975c564cbfe9d17dc3ba0147ffd9f02f66f (diff) |
ducativc1dec: try hard to produce a valid sequence layer header
Make sure the codec data in the sequence layer is always 4 bytes as per STRUCT_C
definition. Some files seem to come with larger, 0 padded, codec_data buffers...
Ensure that the Reserved6 bit of STRUCT_C is always set to 1 as the codec seems
to be strict about this and some files seem to have it set to 0...
Diffstat (limited to 'src')
-rw-r--r-- | src/gstducativc1dec.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gstducativc1dec.c b/src/gstducativc1dec.c index 61291d9..b2d5a84 100644 --- a/src/gstducativc1dec.c +++ b/src/gstducativc1dec.c @@ -155,13 +155,20 @@ gst_ducati_vc1dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf) push_input (vdec, (guint8 *) & val, 4); /* STRUCT_C (preceded by length).. see Table 263, 264 */ - val = GST_BUFFER_SIZE (vdec->codec_data); + val = 0x00000004; + push_input (vdec, (guint8 *) & val, 4); + + val = GST_READ_UINT32_LE (GST_BUFFER_DATA (vdec->codec_data)); + /* FIXME: i have NO idea why asfdemux gives me something I need to patch... */ + val |= 0x01 << 24; push_input (vdec, (guint8 *) & val, 4); - push_input (vdec, GST_BUFFER_DATA (vdec->codec_data), val); /* STRUCT_A.. see Table 260 and Annex J.2 */ - push_input (vdec, (guint8 *) & vdec->height, 4); - push_input (vdec, (guint8 *) & vdec->width, 4); + val = vdec->height; + push_input (vdec, (guint8 *) & val, 4); + val = vdec->width; + push_input (vdec, (guint8 *) & val, 4); + GST_INFO_OBJECT (vdec, "seq hdr resolution: %dx%d", vdec->width, vdec->height); val = 0x0000000c; push_input (vdec, (guint8 *) & val, 4); |