Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
GNOME:GNOME1
avifile
avifile-0.7-0.7.43-a52bin.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File avifile-0.7-0.7.43-a52bin.patch of Package avifile
--- avifile-0.7-0.7.43/ffmpeg/libavcodec/Makefile.am +++ avifile-0.7-0.7.43/ffmpeg/libavcodec/Makefile.am @@ -12,6 +12,7 @@ #endif noinst_HEADERS = \ + a52dec.h \ ac3.h \ ac3tab.h \ avcodec.h \ @@ -150,6 +151,16 @@ # $(OGGSRC) +if AMM_FF_A52BIN +LIBA52 = +SUBDIRS_LIBA52 = +A52BIN_CPPFLAGS = -DCONFIG_A52BIN +else +SUBDIRS_LIBA52 = liba52 +LIBA52 = liba52/liba52.la +A52BIN_CPPFLAGS = +endif + #if AMM_USE_FAST_BUILD #libaviplayavcodec_la_SOURCES = libavcodec.c #libaviplayavcodec_la_LIBADD = $(LIBA52) @@ -162,7 +173,7 @@ alpha/libavcodecalpha.la \ armv4l/libavcodecarmv4l.la \ i386/libavcodeci386.la \ - liba52/liba52.la \ + $(LIBA52) \ mlib/libavcodecmlib.la \ ppc/libavcodecppc.la \ ps2/libavcodecps2.la \ @@ -201,7 +212,8 @@ xvmcvideo.c \ w32thread.c -AM_CPPFLAGS = $(LTNOPIC) -DHAVE_AV_CONFIG_H -DHAVE_THREADS -I$(srcdir)/.. +AM_CPPFLAGS = $(LTNOPIC) -DHAVE_AV_CONFIG_H -DHAVE_THREADS -I$(srcdir)/.. \ + $(A52BIN_CPPFLAGS) #INSTRUMENT = -finstrument-functions CFLAGS = $(FFMPEG_CFLAGS) $(INSTRUMENT) --- avifile-0.7-0.7.43/ffmpeg/libavcodec/a52dec.c +++ avifile-0.7-0.7.43/ffmpeg/libavcodec/a52dec.c @@ -24,6 +24,7 @@ #include "avcodec.h" #include "liba52/a52.h" +#include "a52dec.h" #ifdef CONFIG_A52BIN #include <dlfcn.h> @@ -34,46 +35,15 @@ * liba52 - Copyright (C) Aaron Holtzman * released under the GPL license. */ -typedef struct AC3DecodeState { - uint8_t inbuf[4096]; /* input buffer */ - uint8_t *inbuf_ptr; - int frame_size; - int flags; - int channels; - a52_state_t* state; - sample_t* samples; - - /* - * virtual method table - * - * using this function table so the liba52 doesn't - * have to be really linked together with ffmpeg - * and might be linked in runtime - this allows binary - * distribution of ffmpeg library which doens't depend - * on liba52 library - but if user has it installed - * it will be used - user might install such library - * separately - */ - void* handle; - a52_state_t* (*a52_init)(uint32_t mm_accel); - sample_t* (*a52_samples)(a52_state_t * state); - int (*a52_syncinfo)(uint8_t * buf, int * flags, - int * sample_rate, int * bit_rate); - int (*a52_frame)(a52_state_t * state, uint8_t * buf, int * flags, - sample_t * level, sample_t bias); - void (*a52_dynrng)(a52_state_t * state, - sample_t (* call) (sample_t, void *), void * data); - int (*a52_block)(a52_state_t * state); - void (*a52_free)(a52_state_t * state); - -} AC3DecodeState; #ifdef CONFIG_A52BIN static void* dlsymm(void* handle, const char* symbol) { void* f = dlsym(handle, symbol); if (!f) +#undef fprintf fprintf(stderr, "A52 Decoder - function '%s' can't be resolved\n", symbol); +#define fprintf please_use_av_log return f; } #endif @@ -86,7 +56,9 @@ s->handle = dlopen(liba52name, RTLD_LAZY); if (!s->handle) { +#undef fprintf fprintf(stderr, "A52 library %s could not be opened! \n%s\n", liba52name, dlerror()); +#define fprintf please_use_av_log return -1; } s->a52_init = (a52_state_t* (*)(uint32_t)) dlsymm(s->handle, "a52_init"); --- avifile-0.7-0.7.43/ffmpeg/libavcodec/a52dec.h +++ avifile-0.7-0.7.43/ffmpeg/libavcodec/a52dec.h @@ -0,0 +1,35 @@ +#include "liba52/a52.h" + +typedef struct AC3DecodeState { + uint8_t inbuf[4096]; /* input buffer */ + uint8_t *inbuf_ptr; + int frame_size; + int flags; + int channels; + a52_state_t* state; + sample_t* samples; + + /* + * virtual method table + * + * using this function table so the liba52 doesn't + * have to be really linked together with ffmpeg + * and might be linked in runtime - this allows binary + * distribution of ffmpeg library which doens't depend + * on liba52 library - but if user has it installed + * it will be used - user might install such library + * separately + */ + void* handle; + a52_state_t* (*a52_init)(uint32_t mm_accel); + sample_t* (*a52_samples)(a52_state_t * state); + int (*a52_syncinfo)(uint8_t * buf, int * flags, + int * sample_rate, int * bit_rate); + int (*a52_frame)(a52_state_t * state, uint8_t * buf, int * flags, + sample_t * level, sample_t bias); + void (*a52_dynrng)(a52_state_t * state, + sample_t (* call) (sample_t, void *), void * data); + int (*a52_block)(a52_state_t * state); + void (*a52_free)(a52_state_t * state); + +} AC3DecodeState; --- avifile-0.7-0.7.43/ffmpeg/libavcodec/parser.c +++ avifile-0.7-0.7.43/ffmpeg/libavcodec/parser.c @@ -20,6 +20,7 @@ #include "avcodec.h" #include "mpegvideo.h" #include "mpegaudio.h" +#include "a52dec.h" AVCodecParser *av_first_parser = NULL; @@ -669,9 +670,6 @@ } #ifdef CONFIG_AC3 -extern int a52_syncinfo (const uint8_t * buf, int * flags, - int * sample_rate, int * bit_rate); - typedef struct AC3ParseContext { uint8_t inbuf[4096]; /* input buffer */ uint8_t *inbuf_ptr; @@ -695,6 +693,7 @@ const uint8_t *buf, int buf_size) { AC3ParseContext *s = s1->priv_data; + AC3DecodeState *ds = avctx->priv_data; const uint8_t *buf_ptr; int len, sample_rate, bit_rate; static const int ac3_channels[8] = { @@ -717,7 +716,7 @@ s->inbuf_ptr += len; buf_size -= len; if ((s->inbuf_ptr - s->inbuf) == AC3_HEADER_SIZE) { - len = a52_syncinfo(s->inbuf, &s->flags, &sample_rate, &bit_rate); + len = ds->a52_syncinfo(s->inbuf, &s->flags, &sample_rate, &bit_rate); if (len == 0) { /* no sync found : move by one byte (inefficient, but simple!) */ memmove(s->inbuf, s->inbuf + 1, AC3_HEADER_SIZE - 1);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor