1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  pthread: make sure AVFrame.extended_data is set properly.
  libfdk-aac: reindent after last commit
  libfdk-aac: Limit to supported sample rates.
  cbrt_tablegen: Include libm.h
  oggparsetheora: make it more robust
  ogg: prevent NULL pointer deference in theora gptopts

Conflicts:
	libavformat/oggparsetheora.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-09-25 16:11:34 +02:00
commit abcaacf1ac
4 changed files with 39 additions and 20 deletions

View File

@ -21,6 +21,7 @@
*/
#include <stdlib.h>
#include "libavutil/libm.h"
#define CONFIG_HARDCODED_TABLES 0
#include "cbrt_tablegen.h"
#include "tableprint.h"

View File

@ -391,6 +391,11 @@ static const uint64_t aac_channel_layout[] = {
0,
};
static const int aac_sample_rates[] = {
96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000, 0
};
AVCodec ff_libfdk_aac_encoder = {
.name = "libfdk_aac",
.type = AVMEDIA_TYPE_AUDIO,
@ -406,5 +411,6 @@ AVCodec ff_libfdk_aac_encoder = {
.priv_class = &aac_enc_class,
.defaults = aac_encode_defaults,
.profiles = profiles,
.supported_samplerates = aac_sample_rates,
.channel_layouts = aac_channel_layout,
};

View File

@ -387,6 +387,10 @@ static attribute_align_arg void *frame_worker_thread(void *arg)
p->got_frame = 0;
p->result = codec->decode(avctx, &p->frame, &p->got_frame, &p->avpkt);
/* many decoders assign whole AVFrames, thus overwriting extended_data;
* make sure it's set correctly */
p->frame.extended_data = p->frame.data;
if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx);
pthread_mutex_lock(&p->progress_mutex);

View File

@ -53,7 +53,8 @@ theora_header (AVFormatContext * s, int idx)
os->private = thp;
}
if (os->buf[os->pstart] == 0x80) {
switch (os->buf[os->pstart]) {
case 0x80: {
GetBitContext gb;
int width, height;
AVRational timebase;
@ -109,9 +110,16 @@ theora_header (AVFormatContext * s, int idx)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_THEORA;
st->need_parsing = AVSTREAM_PARSE_HEADERS;
} else if (os->buf[os->pstart] == 0x81) {
ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8);
}
break;
case 0x81:
ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8);
case 0x82:
if (!thp->version)
return -1;
break;
default:
return -1;
}
st->codec->extradata = av_realloc (st->codec->extradata,