Commit 5c6a19d1 authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Update: Moved code for handling unknown codecs out of main file

parent aecbc539
## Process this file with automake to produce Makefile.in
mans = ogginfo.1
ogginfosources = ogginfo2.c theora.c
ogginfosources = ogginfo2.c theora.c codec_other.c
noinst_HEADERS = \
private.h \
theora.h
datadir = @datadir@
......
/* Ogginfo
*
* A tool to describe ogg file contents and metadata.
*
* This file handles codecs we have no specific handling for.
*
* Copyright 2002-2005 Michael Smith <msmith@xiph.org>
* Copyright 2020 Philipp Schafft <lion@lion.leolix.org>
* Licensed under the GNU GPL, distributed with this program.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <ogg/ogg.h>
#include "private.h"
static void process_other(stream_processor *stream, ogg_page *page )
{
ogg_packet packet;
ogg_stream_pagein(&stream->os, page);
while (ogg_stream_packetout(&stream->os, &packet) > 0) {
/* Should we do anything here? Currently, we don't */
}
}
void other_start(stream_processor *stream, char *type)
{
if (type) {
stream->type = type;
} else {
stream->type = "unknown";
}
stream->process_page = process_other;
stream->process_end = NULL;
}
......@@ -33,6 +33,8 @@
#include "theora.h"
#include "private.h"
#define CHUNK 4500
static const struct vorbis_release {
......@@ -64,27 +66,6 @@ static const struct vorbis_release {
* serial-number gaps)
*/
typedef struct _stream_processor {
void (*process_page)(struct _stream_processor *, ogg_page *);
void (*process_end)(struct _stream_processor *);
int isillegal;
int constraint_violated;
int shownillegal;
int isnew;
long seqno;
int lostseq;
int start;
int end;
int num;
char *type;
ogg_uint32_t serial; /* must be 32 bit unsigned */
ogg_stream_state os;
void *data;
} stream_processor;
typedef struct {
stream_processor *streams;
int allocated;
......@@ -875,18 +856,6 @@ static void process_null(stream_processor *stream, ogg_page *page)
/* This is for invalid streams. */
}
static void process_other(stream_processor *stream, ogg_page *page )
{
ogg_packet packet;
ogg_stream_pagein(&stream->os, page);
while (ogg_stream_packetout(&stream->os, &packet) > 0) {
/* Should we do anything here? Currently, we don't */
}
}
static void free_stream_set(stream_set *set)
{
int i;
......@@ -923,17 +892,6 @@ static void null_start(stream_processor *stream)
stream->process_page = process_null;
}
static void other_start(stream_processor *stream, char *type)
{
if (type) {
stream->type = type;
} else {
stream->type = "unknown";
}
stream->process_page = process_other;
stream->process_end = NULL;
}
static void theora_start(stream_processor *stream)
{
misc_theora_info *info;
......
/* Ogginfo
*
* A tool to describe ogg file contents and metadata.
*
* This file is a common header for the code files.
*
* Copyright 2002-2005 Michael Smith <msmith@xiph.org>
* Copyright 2020 Philipp Schafft <lion@lion.leolix.org>
* Licensed under the GNU GPL, distributed with this program.
*/
#ifndef __VORBIS_TOOLS__PRIVATE_H__
#define __VORBIS_TOOLS__PRIVATE_H__
typedef struct _stream_processor {
void (*process_page)(struct _stream_processor *, ogg_page *);
void (*process_end)(struct _stream_processor *);
int isillegal;
int constraint_violated;
int shownillegal;
int isnew;
long seqno;
int lostseq;
int start;
int end;
int num;
char *type;
ogg_uint32_t serial; /* must be 32 bit unsigned */
ogg_stream_state os;
void *data;
} stream_processor;
void other_start(stream_processor *stream, char *type);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment