Commit e366e6bf authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  ppc: drop unused function dct_quantize_altivec()
  mpegaudiodec: Do not discard mp_decode_frame() return value.
  matroska: do not set invalid default duration if frame rate is zero
  mkv: use av_reduce instead of av_d2q for framerate estimation
  mkv: report average framerate as minimal as well
  avcodec_string: Favor AVCodecContext.codec over the default codec.
  cook: Make constants passed to AV_BE2NE32C() unsigned to avoid signed overflow.

Conflicts:
	libavcodec/cook.c
	libavcodec/ppc/mpegvideo_altivec.c
	libavcodec/utils.c
	libavformat/matroskadec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents a02f8ef1 0f53601a
......@@ -280,8 +280,8 @@ static av_cold void init_cplscales_table(COOKContext *q)
static inline int decode_bytes(const uint8_t *inbuffer, uint8_t *out, int bytes)
{
static const uint32_t tab[4] = {
AV_BE2NE32C(0x37c511f2U), AV_BE2NE32C(0xf237c511U),
AV_BE2NE32C(0x11f237c5U), AV_BE2NE32C(0xc511f237U),
AV_BE2NE32C(0x37c511f2u), AV_BE2NE32C(0xf237c511u),
AV_BE2NE32C(0x11f237c5u), AV_BE2NE32C(0xc511f237u),
};
int i, off;
uint32_t c;
......
......@@ -131,9 +131,6 @@ void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_s
int j;
j = src_scantable[i];
st->permutated[i] = permutation[j];
#if ARCH_PPC
st->inverse[j] = i;
#endif
}
end=-1;
......
......@@ -197,10 +197,6 @@ typedef struct ScanTable{
const uint8_t *scantable;
uint8_t permutated[64];
uint8_t raster_end[64];
#if ARCH_PPC
/** Used by dct_quantize_altivec to find last-non-zero */
DECLARE_ALIGNED(16, uint8_t, inverse)[64];
#endif
} ScanTable;
void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
......
......@@ -1733,6 +1733,10 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data,
s->frame_size = len;
out_size = mp_decode_frame(s, NULL, buf, buf_size);
if (out_size < 0) {
av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n");
return AVERROR_INVALIDDATA;
}
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
......
This diff is collapsed.
......@@ -1757,8 +1757,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
codec_type = av_get_media_type_string(enc->codec_type);
codec_name = avcodec_get_name(enc->codec_id);
if (enc->profile != FF_PROFILE_UNKNOWN) {
p = encode ? avcodec_find_encoder(enc->codec_id) :
avcodec_find_decoder(enc->codec_id);
if (enc->codec)
p = enc->codec;
else
p = encode ? avcodec_find_encoder(enc->codec_id) :
avcodec_find_decoder(enc->codec_id);
if (p)
profile = av_get_profile_name(p, enc->profile);
}
......
......@@ -1448,7 +1448,7 @@ static int matroska_read_header(AVFormatContext *s)
continue;
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
if (!track->default_duration)
if (!track->default_duration && track->video.frame_rate > 0)
track->default_duration = 1000000000/track->video.frame_rate;
if (!track->video.display_width)
track->video.display_width = track->video.pixel_width;
......@@ -1661,8 +1661,11 @@ static int matroska_read_header(AVFormatContext *s)
st->codec-> width * track->video.display_height,
255);
st->need_parsing = AVSTREAM_PARSE_HEADERS;
if (track->default_duration)
st->avg_frame_rate = av_d2q(1000000000.0/track->default_duration, INT_MAX);
if (track->default_duration) {
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
1000000000, track->default_duration, 30000);
st->avg_frame_rate = st->r_frame_rate;
}
/* export stereo mode flag as metadata tag */
if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREO_MODE_COUNT)
......
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