Commit e7c538dc authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Feature: Added stub for Skeleton support in ogginfo

parent 720af745
......@@ -11,6 +11,7 @@ ogginfosources = \
codec_opus.c \
codec_speex.c \
codec_flac.c \
codec_skeleton.c \
codec_other.c \
codec_invalid.c
......
/* 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-2021 Philipp Schafft <lion@lion.leolix.org>
* Licensed under the GNU GPL, distributed with this program.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <ogg/ogg.h>
#include "i18n.h"
#include "private.h"
typedef struct {
} misc_skeleton_info;
static void skeleton_process(stream_processor *stream, ogg_page *page)
{
misc_skeleton_info *self = stream->data;
ogg_stream_pagein(&stream->os, page);
while (1) {
ogg_packet packet;
int res = ogg_stream_packetout(&stream->os, &packet);
if (res < 0) {
warn(_("WARNING: discontinuity in stream (%d)\n"), stream->num);
continue;
} else if (res == 0) {
break;
}
// TODO.
}
}
static void skeleton_end(stream_processor *stream)
{
misc_skeleton_info *self = stream->data;
free(stream->data);
}
void skeleton_start(stream_processor *stream)
{
stream->type = "skeleton";
stream->process_page = skeleton_process;
stream->process_end = skeleton_end;
stream->data = calloc(1, sizeof(misc_skeleton_info));
}
......@@ -228,7 +228,7 @@ static stream_processor *find_stream_processor(stream_set *set, ogg_page *page)
} else if (packet.bytes >= 8 && memcmp(packet.packet, "Speex ", 8)==0) {
speex_start(stream);
} else if (packet.bytes >= 8 && memcmp(packet.packet, "fishead\0", 8)==0) {
other_start(stream, "skeleton");
skeleton_start(stream);
} else if (packet.bytes >= 5 && memcmp(packet.packet, "BBCD\0", 5)==0) {
other_start(stream, "dirac");
} else if (packet.bytes >= 8 && memcmp(packet.packet, "KW-DIRAC", 8)==0) {
......
......@@ -62,6 +62,7 @@ void kate_start(stream_processor *stream);
void opus_start(stream_processor *stream);
void speex_start(stream_processor *stream);
void flac_start(stream_processor *stream);
void skeleton_start(stream_processor *stream);
void other_start(stream_processor *stream, const char *type);
void invalid_start(stream_processor *stream);
......
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