mirror of
https://github.com/fmang/opustags.git
synced 2025-01-16 05:03:13 +01:00
create ogg.cc for libogg helpers
This commit is contained in:
parent
3c0aad169b
commit
3ba7ba8166
@ -17,6 +17,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_executable(
|
||||
opustags
|
||||
src/ogg.cc
|
||||
src/opus.cc
|
||||
src/opustags.cc
|
||||
)
|
||||
|
12
src/ogg.cc
Normal file
12
src/ogg.cc
Normal file
@ -0,0 +1,12 @@
|
||||
#include "opustags.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
int ot::write_page(ogg_page *og, FILE *stream)
|
||||
{
|
||||
if((ssize_t) fwrite(og->header, 1, og->header_len, stream) < og->header_len)
|
||||
return -1;
|
||||
if((ssize_t) fwrite(og->body, 1, og->body_len, stream) < og->body_len)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
@ -13,14 +13,6 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
int write_page(ogg_page *og, FILE *stream){
|
||||
if((ssize_t) fwrite(og->header, 1, og->header_len, stream) < og->header_len)
|
||||
return -1;
|
||||
if((ssize_t) fwrite(og->body, 1, og->body_len, stream) < og->body_len)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *version = PROJECT_NAME " version " PROJECT_VERSION "\n";
|
||||
|
||||
const char *usage =
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <ogg/ogg.h>
|
||||
|
||||
namespace ot {
|
||||
@ -11,8 +12,14 @@ namespace ot {
|
||||
/**
|
||||
* \defgroup ogg Ogg
|
||||
* \brief Helpers to work with libogg.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
int write_page(ogg_page *og, FILE *stream);
|
||||
|
||||
/** \} */
|
||||
|
||||
/**
|
||||
* \defgroup opus Opus
|
||||
* \brief Opus packet decoding and recoding.
|
||||
|
Loading…
x
Reference in New Issue
Block a user