[MPlayer-users] [PATCH] Update Theora support
Bernhard Rosenkraenzer
bero at arklinux.org
Fri Aug 1 21:25:37 CEST 2003
Hi,
mplayer's theora support is still at theora alpha1 level; theora's API
changed a bit after that.
The patch I've attached works with current theora CVS (should be
compatible with theora alpha2 too, but I haven't tried that).
LLaP
bero
--
Ark Linux - Linux for the masses
http://www.arklinux.org/
Redistribution and processing of this message is subject to
http://www.arklinux.org/terms.php
-------------- next part --------------
--- mplayer/libmpcodecs/vd_theora.c.theora 2003-06-08 15:02:41.000000000 +0200
+++ mplayer/libmpcodecs/vd_theora.c 2003-07-19 03:19:34.000000000 +0200
@@ -31,6 +31,7 @@
typedef struct theora_struct_st {
theora_state st;
theora_info inf;
+ theora_comment com;
} theora_struct_t;
/*
@@ -61,33 +62,18 @@
if (!context)
break;
- /* read initial header */
- op.bytes = ds_get_packet (sh->ds,&op.packet);
- op.b_o_s = 1;
- if((errorCode = theora_decode_header (&context->inf, &op))) {
- mp_msg(MSGT_DECAUDIO,MSGL_ERR,
- "Broken Theora header; erroroCode=%i!\n", errorCode);
- break;
- }
+ theora_comment_init(&context->com);
+ theora_info_init(&context->inf);
- /* decode comment packet */
- op.bytes = ds_get_packet (sh->ds,&op.packet);
- op.b_o_s = 1;
-#if 0
- if((errorCode = theora_decode_comment (&tc, &op))) {
- mp_msg(MSGT_DECVIDEO,MSGL_ERR,
- "Broken Theora comment; erroroCode=%i!\n", errorCode);
- break;
- }
-#endif
-
- /* decode tables packet */
- op.bytes = ds_get_packet (sh->ds,&op.packet);
- op.b_o_s = 1;
- if((errorCode = theora_decode_tables (&context->inf, &op))) {
- mp_msg(MSGT_DECVIDEO,MSGL_ERR,
- "Broken Theora comment; erroroCode=%i!\n", errorCode);
- break;
+ /* read initial headers */
+ for(int i=0; i<3; i++) {
+ op.bytes = ds_get_packet (sh->ds,&op.packet);
+ op.b_o_s = 1;
+ if((errorCode = theora_decode_header (&context->inf, &context->com, &op))) {
+ mp_msg(MSGT_DECVIDEO,MSGL_ERR,
+ "Broken Theora header; erroroCode=%i!\n", errorCode);
+ break;
+ }
}
/* now init codec */
--- mplayer/libmpdemux/demux_ogg.c.theora 2003-07-09 20:22:36.000000000 +0200
+++ mplayer/libmpdemux/demux_ogg.c 2003-07-19 02:40:43.000000000 +0200
@@ -632,8 +632,13 @@
# ifdef HAVE_OGGTHEORA
} else if (pack.bytes >= 7 && !strncmp (&pack.packet[1], "theora", 6)) {
int errorCode = 0;
+ theora_comment tc;
theora_info inf;
- errorCode = theora_decode_header (&inf, &pack);
+
+ theora_comment_init(&tc);
+ theora_info_init(&inf);
+
+ errorCode = theora_decode_header (&inf, &tc, &pack);
if (errorCode)
mp_msg(MSGT_DEMUX,MSGL_ERR,"Theora header parsing failed: %i \n",
errorCode);
More information about the MPlayer-users
mailing list