summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-03-23 22:39:11 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-03-23 22:39:11 +0000
commitf251ab49a1c158e4731d36b2ab468ea1c0a2f475 (patch)
tree590b5eaefc541fb43c5cebf4c272b7e0e21eb413
parent33a7be006f5616af90db6deca50e81d71f0e6101 (diff)
downloadxine-lib-f251ab49a1c158e4731d36b2ab468ea1c0a2f475.tar.gz
xine-lib-f251ab49a1c158e4731d36b2ab468ea1c0a2f475.tar.bz2
content-detection for ogg
CVS patchset: 1623 CVS date: 2002/03/23 22:39:11
-rw-r--r--src/demuxers/demux_ogg.c31
-rw-r--r--src/xine-utils/xineutils.h3
2 files changed, 32 insertions, 2 deletions
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
index f5aeb8487..e6430ae86 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/demuxers/demux_ogg.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: demux_ogg.c,v 1.16 2002/03/11 12:31:24 guenter Exp $
+ * $Id: demux_ogg.c,v 1.17 2002/03/23 22:39:11 guenter Exp $
*
* demultiplexer for ogg streams
*
@@ -359,6 +359,35 @@ static int demux_ogg_open(demux_plugin_t *this_gen,
switch(stage) {
case STAGE_BY_CONTENT:
+ {
+ uint8_t buf[4096];
+
+ if((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) {
+
+ input->seek(input, 0, SEEK_SET);
+
+ if (input->read(input, buf, 4)) {
+
+ if ((buf[0] == 'O')
+ && (buf[1] == 'g')
+ && (buf[2] == 'g')
+ && (buf[3] == 'S')) {
+ this->input = input;
+ return DEMUX_CAN_HANDLE;
+ }
+ }
+ }
+
+ if (input->get_optional_data (input, buf, INPUT_OPTIONAL_DATA_PREVIEW)) {
+ if ((buf[0] == 'O')
+ && (buf[1] == 'g')
+ && (buf[2] == 'g')
+ && (buf[3] == 'S')) {
+ this->input = input;
+ return DEMUX_CAN_HANDLE;
+ }
+ }
+ }
return DEMUX_CANNOT_HANDLE;
break;
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 349fc594f..ca8085d57 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xineutils.h,v 1.10 2002/03/21 21:30:51 guenter Exp $
+ * $Id: xineutils.h,v 1.11 2002/03/23 22:39:11 guenter Exp $
*
*/
#ifndef XINEUTILS_H
@@ -31,6 +31,7 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
+#include <pthread.h>
#include "attributes.h"
#include "compat.h"