summaryrefslogtreecommitdiffstats
path: root/ext/divx/gstdivxdec.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-01-23 10:56:57 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-01-23 10:56:57 +0000
commit0c2e4e1cc2e5444f29e79714ccd94f4520dfaed2 (patch)
tree8d98d5d0f8420ab673f82915f75ba3f0b90884b0 /ext/divx/gstdivxdec.c
parent0b4511b951f362a35fb5103db321ea5db1d71571 (diff)
downloadgst-plugins-bad-0c2e4e1cc2e5444f29e79714ccd94f4520dfaed2.tar.gz
gst-plugins-bad-0c2e4e1cc2e5444f29e79714ccd94f4520dfaed2.tar.bz2
gst-plugins-bad-0c2e4e1cc2e5444f29e79714ccd94f4520dfaed2.zip
ext/divx/gstdivxdec.*: Fix divx3 ("msmpeg4") playback using divxdec.
Original commit message from CVS: 2004-01-23 Ronald Bultje <rbultje@ronald.bitfreak.net> * ext/divx/gstdivxdec.c: (gst_divxdec_init), (gst_divxdec_setup): * ext/divx/gstdivxdec.h: Fix divx3 ("msmpeg4") playback using divxdec.
Diffstat (limited to 'ext/divx/gstdivxdec.c')
-rw-r--r--ext/divx/gstdivxdec.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/divx/gstdivxdec.c b/ext/divx/gstdivxdec.c
index 1f3e68fa..869858a2 100644
--- a/ext/divx/gstdivxdec.c
+++ b/ext/divx/gstdivxdec.c
@@ -185,6 +185,7 @@ gst_divxdec_init (GstDivxDec *divxdec)
/* bitrate, etc. */
divxdec->width = divxdec->height = divxdec->csp = divxdec->bitcnt = -1;
+ divxdec->version = 0;
/* set divx handle to NULL */
divxdec->handle = NULL;
@@ -213,7 +214,20 @@ gst_divxdec_setup (GstDivxDec *divxdec)
/* initialize the handle */
memset(&xinit, 0, sizeof(DEC_INIT));
xinit.smooth_playback = 0;
- xinit.codec_version = 500;
+ switch (divxdec->version) {
+ case 3:
+ xinit.codec_version = 311;
+ break;
+ case 4:
+ xinit.codec_version = 400;
+ break;
+ case 5:
+ xinit.codec_version = 500;
+ break;
+ default:
+ xinit.codec_version = 0;
+ break;
+ }
if ((ret = decore(&handle, DEC_OPT_INIT, &xinit, NULL)) != 0) {
gst_element_error (divxdec, LIBRARY, INIT, NULL,
("divx library error: %s (%d)", gst_divxdec_error (ret), ret));
@@ -439,6 +453,7 @@ gst_divxdec_connect (GstPad *pad,
gst_structure_get_int(structure, "width", &divxdec->width);
gst_structure_get_int(structure, "height", &divxdec->height);
gst_structure_get_double(structure, "framerate", &divxdec->fps);
+ gst_structure_get_int(structure, "divxversion", &divxdec->version);
return gst_divxdec_negotiate(divxdec);
}