openbsd-ports/audio/aqualung/patches/patch-src_decoder_dec_lavc_c

42 lines
1.4 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-src_decoder_dec_lavc_c,v 1.3 2013/01/26 12:47:44 brad Exp $
Update for newer FFmpeg API.
--- src/decoder/dec_lavc.c.orig Thu Aug 20 14:11:11 2009
+++ src/decoder/dec_lavc.c Fri Jan 18 00:34:08 2013
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <libavutil/avutil.h>
#include "dec_lavc.h"
@@ -53,7 +54,7 @@ decode_lavc(decoder_t * dec) {
if (packet.stream_index == pd->audioStream) {
- avcodec_decode_audio2(pd->avCodecCtx, samples, &n_bytes, packet.data, packet.size);
+ avcodec_decode_audio3(pd->avCodecCtx, samples, &n_bytes, &packet);
if (n_bytes > 0) {
int i;
for (i = 0; i < n_bytes/2; i++) {
@@ -111,7 +112,7 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
file_decoder_t * fdec = dec->fdec;
int i;
- if (av_open_input_file(&pd->avFormatCtx, filename, NULL, 0, NULL) != 0)
+ if (avformat_open_input(&pd->avFormatCtx, filename, NULL, NULL) != 0)
return DECODER_OPEN_BADLIB;
if (av_find_stream_info(pd->avFormatCtx) < 0)
@@ -124,7 +125,7 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
pd->audioStream = -1;
for (i = 0; i < pd->avFormatCtx->nb_streams; i++) {
- if (pd->avFormatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {
+ if (pd->avFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
pd->audioStream = i;
break;
}