Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c2eb668617 | ||
![]() |
c9c223ba00 | ||
![]() |
9d0ff6436e | ||
![]() |
02b7b125b5 | ||
![]() |
5643668308 | ||
![]() |
2d18e7f3ef | ||
![]() |
f1b5830182 | ||
![]() |
c588316555 | ||
![]() |
afd1f61944 | ||
![]() |
16a9c5ea9e | ||
![]() |
83fb31a76d | ||
![]() |
fc5b32877a | ||
![]() |
10e023c4fa | ||
![]() |
27a3a59428 | ||
![]() |
8ab849cddc | ||
![]() |
5191b00155 | ||
![]() |
1131e7a1a4 | ||
![]() |
26becbcd2a | ||
![]() |
366cdd3548 | ||
![]() |
e3b08b3ad4 | ||
![]() |
fa16440659 | ||
![]() |
c36fd16aaa | ||
![]() |
8c5897632a | ||
![]() |
b34fce9c54 | ||
![]() |
742f9aa879 | ||
![]() |
79041d92ee | ||
![]() |
82cebc0e05 | ||
![]() |
09abca6802 | ||
![]() |
43d64829e6 | ||
![]() |
4a479fd3e6 | ||
![]() |
4f41717d01 | ||
![]() |
6896dcbf5f | ||
![]() |
14404170b9 | ||
![]() |
e9e42beed2 | ||
![]() |
abd6decd55 | ||
![]() |
0385c824f1 | ||
![]() |
c4e764aa69 | ||
![]() |
9d02e38d3f | ||
![]() |
30cf47c6f0 | ||
![]() |
b45cd17d29 | ||
![]() |
26b6d70c72 | ||
![]() |
32919db4fb | ||
![]() |
56f44c26f0 | ||
![]() |
fe87a40de6 | ||
![]() |
0f6e309b97 | ||
![]() |
96e13c9897 |
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.2.1
|
||||
PROJECT_NUMBER = 2.2.2
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
2
ffmpeg.c
2
ffmpeg.c
@@ -514,6 +514,8 @@ static void ffmpeg_cleanup(int ret)
|
||||
if (received_sigterm) {
|
||||
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
|
||||
(int) received_sigterm);
|
||||
} else if (ret) {
|
||||
av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
|
||||
}
|
||||
term_exit();
|
||||
}
|
||||
|
@@ -44,12 +44,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
|
||||
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
|
||||
enum AVPixelFormat best= AV_PIX_FMT_NONE;
|
||||
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
|
||||
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
|
||||
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
p = mjpeg_formats;
|
||||
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
p =ljpeg_formats;
|
||||
}
|
||||
}
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
|
@@ -246,6 +246,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
|
||||
vald /= pow(10, index * 3);
|
||||
prefix_string = decimal_unit_prefixes[index];
|
||||
}
|
||||
vali = vald;
|
||||
}
|
||||
|
||||
if (show_float || (use_value_prefix && vald != (long long int)vald))
|
||||
@@ -336,7 +337,7 @@ static const AVOption writer_options[] = {
|
||||
{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_REPLACE}, .unit = "sv" },
|
||||
{ "fail", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_FAIL}, .unit = "sv" },
|
||||
{ "string_validation_replacement", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
|
||||
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
|
||||
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str="\xEF\xBF\xBD"}},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
@@ -1370,7 +1370,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
|
||||
* Decode VQ encoded high frequencies
|
||||
*/
|
||||
if (s->subband_activity[k] > s->vq_start_subband[k]) {
|
||||
if (!s->debug_flag & 0x01) {
|
||||
if (!(s->debug_flag & 0x01)) {
|
||||
av_log(s->avctx, AV_LOG_DEBUG,
|
||||
"Stream with high frequencies VQ coding\n");
|
||||
s->debug_flag |= 0x01;
|
||||
|
@@ -1355,8 +1355,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
|
||||
motion_y >>= s->chroma_y_shift;
|
||||
}
|
||||
|
||||
mx = motion_x & ~(-1 << s->mv_precision);
|
||||
my = motion_y & ~(-1 << s->mv_precision);
|
||||
mx = motion_x & ~(-1U << s->mv_precision);
|
||||
my = motion_y & ~(-1U << s->mv_precision);
|
||||
motion_x >>= s->mv_precision;
|
||||
motion_y >>= s->mv_precision;
|
||||
/* normalize subpel coordinates to epel */
|
||||
|
@@ -246,8 +246,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
|
||||
ctx->slice_data[slice].y_off = y_off;
|
||||
}
|
||||
|
||||
if (ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
|
||||
NULL, nslices, sizeof(ctx->slice_data[0])) < 0)
|
||||
if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
|
||||
NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
|
||||
return ret;
|
||||
|
||||
skip:
|
||||
|
@@ -2285,7 +2285,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
|
||||
if (p->cur_rate == RATE_6300) {
|
||||
info_bits = 0;
|
||||
put_bits(&pb, 2, info_bits);
|
||||
}
|
||||
}else
|
||||
av_assert0(0);
|
||||
|
||||
put_bits(&pb, 8, p->lsp_index[2]);
|
||||
put_bits(&pb, 8, p->lsp_index[1]);
|
||||
|
@@ -81,6 +81,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
|
||||
libx265Context *ctx = avctx->priv_data;
|
||||
x265_nal *nal;
|
||||
uint8_t *buf;
|
||||
char sar[10];
|
||||
int sar_num, sar_den;
|
||||
int nnal;
|
||||
int ret;
|
||||
@@ -121,11 +122,11 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
|
||||
av_reduce(&sar_num, &sar_den,
|
||||
avctx->sample_aspect_ratio.num,
|
||||
avctx->sample_aspect_ratio.den, 4096);
|
||||
ctx->params->bEnableVuiParametersPresentFlag = 1;
|
||||
ctx->params->bEnableAspectRatioIdc = 1;
|
||||
ctx->params->aspectRatioIdc = 255;
|
||||
ctx->params->sarWidth = sar_num;
|
||||
ctx->params->sarHeight = sar_den;
|
||||
snprintf(sar, sizeof(sar), "%d:%d", sar_num, sar_den);
|
||||
if (x265_param_parse(ctx->params, "sar", sar) == X265_PARAM_BAD_VALUE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid SAR: %d:%d.\n", sar_num, sar_den);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (x265_max_bit_depth == 8)
|
||||
ctx->params->internalBitDepth = 8;
|
||||
|
@@ -1251,7 +1251,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
}
|
||||
|
||||
if (!Al) {
|
||||
s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
|
||||
s->coefs_finished[c] |= (2LL << se) - (1LL << ss);
|
||||
last_scan = !~s->coefs_finished[c];
|
||||
}
|
||||
|
||||
|
@@ -487,7 +487,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
|
||||
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
|
||||
}
|
||||
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64])
|
||||
{
|
||||
int i;
|
||||
if (s->chroma_format == CHROMA_444) {
|
||||
|
@@ -61,6 +61,6 @@ void ff_mjpeg_encode_stuffing(MpegEncContext *s);
|
||||
void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3]);
|
||||
void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
|
||||
uint8_t *huff_size, uint16_t *huff_code);
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);
|
||||
|
||||
#endif /* AVCODEC_MJPEGENC_H */
|
||||
|
@@ -1774,7 +1774,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!avctx->hwaccel) {
|
||||
if (!avctx->hwaccel && !(avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)) {
|
||||
for(i=0; i<avctx->height; i++)
|
||||
memset(s->last_picture_ptr->f.data[0] + s->last_picture_ptr->f.linesize[0]*i,
|
||||
0x80, avctx->width);
|
||||
|
@@ -1912,9 +1912,10 @@ static void vc1_interp_mc(VC1Context *v)
|
||||
uvmx = (mx + ((mx & 3) == 3)) >> 1;
|
||||
uvmy = (my + ((my & 3) == 3)) >> 1;
|
||||
if (v->field_mode) {
|
||||
if (v->cur_field_type != v->ref_field_type[1])
|
||||
if (v->cur_field_type != v->ref_field_type[1]) {
|
||||
my = my - 2 + 4 * v->cur_field_type;
|
||||
uvmy = uvmy - 2 + 4 * v->cur_field_type;
|
||||
}
|
||||
}
|
||||
if (v->fastuvmc) {
|
||||
uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1));
|
||||
|
@@ -701,8 +701,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
|
||||
res_setup->partition_size = get_bits(gb, 24) + 1;
|
||||
/* Validations to prevent a buffer overflow later. */
|
||||
if (res_setup->begin>res_setup->end ||
|
||||
res_setup->end > (res_setup->type == 2 ? vc->audio_channels : 1) * vc->blocksize[1] / 2 ||
|
||||
(res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
|
||||
(res_setup->end-res_setup->begin) / res_setup->partition_size > FFMIN(V_MAX_PARTITIONS, 65535)) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR,
|
||||
"partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
|
||||
res_setup->type, res_setup->begin, res_setup->end,
|
||||
@@ -1372,6 +1371,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
||||
unsigned pass, ch_used, i, j, k, l;
|
||||
unsigned max_output = (ch - 1) * vlen;
|
||||
int ptns_to_read = vr->ptns_to_read;
|
||||
int libvorbis_bug = 0;
|
||||
|
||||
if (vr_type == 2) {
|
||||
for (j = 1; j < ch; ++j)
|
||||
@@ -1386,8 +1386,13 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
||||
}
|
||||
|
||||
if (max_output > ch_left * vlen) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (max_output <= ch_left * vlen + vr->partition_size*ch_used/ch) {
|
||||
ptns_to_read--;
|
||||
libvorbis_bug = 1;
|
||||
} else {
|
||||
av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
av_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
|
||||
@@ -1496,6 +1501,14 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
||||
voffset += vr->partition_size;
|
||||
}
|
||||
}
|
||||
if (libvorbis_bug && !pass) {
|
||||
for (j = 0; j < ch_used; ++j) {
|
||||
if (!do_not_decode[j]) {
|
||||
get_vlc2(&vc->gb, vc->codebooks[vr->classbook].vlc.table,
|
||||
vc->codebooks[vr->classbook].nb_bits, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -343,7 +343,7 @@ DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders)[] = {
|
||||
"movdqa %%xmm6, 4*16("dct") \n\t" \
|
||||
"movdqa "SREG2", 7*16("dct") \n\t"
|
||||
|
||||
inline void ff_idct_xvid_sse2(short *block)
|
||||
av_extern_inline void ff_idct_xvid_sse2(short *block)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(m127)", %%mm0 \n\t"
|
||||
|
@@ -1204,6 +1204,8 @@ static int opengl_draw(AVFormatContext *h, void *input, int repaint, int is_pkt)
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
if (!repaint) {
|
||||
if (is_pkt)
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
LOAD_TEXTURE_DATA(0, 0)
|
||||
if (desc->flags & AV_PIX_FMT_FLAG_PLANAR) {
|
||||
LOAD_TEXTURE_DATA(1, 1)
|
||||
|
@@ -279,7 +279,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame)
|
||||
p2 += 8 * linesize;
|
||||
}
|
||||
emms_c();
|
||||
mafd = nb_sad ? sad / nb_sad : 0;
|
||||
mafd = nb_sad ? (double)sad / nb_sad : 0;
|
||||
diff = fabs(mafd - select->prev_mafd);
|
||||
ret = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
|
||||
select->prev_mafd = mafd;
|
||||
|
@@ -38,7 +38,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
for (j = 0; j < fmts->nb_formats; j++) \
|
||||
if(av_get_pix_fmt_name(fmts->formats[j])) \
|
||||
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, \
|
||||
i, filter_ctx->inout##put_pads[i].name, \
|
||||
av_get_pix_fmt_name(fmts->formats[j])); \
|
||||
} else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
|
||||
AVFilterFormats *fmts; \
|
||||
@@ -47,7 +47,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
fmts = filter_ctx->inout##puts[i]->outin##_formats; \
|
||||
for (j = 0; j < fmts->nb_formats; j++) \
|
||||
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, \
|
||||
i, filter_ctx->inout##put_pads[i].name, \
|
||||
av_get_sample_fmt_name(fmts->formats[j])); \
|
||||
\
|
||||
layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
|
||||
@@ -56,7 +56,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
av_get_channel_layout_string(buf, sizeof(buf), -1, \
|
||||
layouts->channel_layouts[j]); \
|
||||
printf(#INOUT "PUT[%d] %s: chlayout:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, buf); \
|
||||
i, filter_ctx->inout##put_pads[i].name, buf); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -113,12 +113,12 @@ int main(int argc, char **argv)
|
||||
/* create a link for each of the input pads */
|
||||
for (i = 0; i < filter_ctx->nb_inputs; i++) {
|
||||
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
|
||||
link->type = filter_ctx->filter->inputs[i].type;
|
||||
link->type = filter_ctx->input_pads[i].type;
|
||||
filter_ctx->inputs[i] = link;
|
||||
}
|
||||
for (i = 0; i < filter_ctx->nb_outputs; i++) {
|
||||
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
|
||||
link->type = filter_ctx->filter->outputs[i].type;
|
||||
link->type = filter_ctx->output_pads[i].type;
|
||||
filter_ctx->outputs[i] = link;
|
||||
}
|
||||
|
||||
|
@@ -31,9 +31,10 @@ static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
|
||||
{
|
||||
char *format;
|
||||
char layout[64];
|
||||
AVBPrint dummy_buffer = { 0 };
|
||||
|
||||
if (!buf)
|
||||
buf = &(AVBPrint){ 0 }; /* dummy buffer */
|
||||
buf = &dummy_buffer;
|
||||
switch (link->type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
format = av_x_if_null(av_get_pix_fmt_name(link->format), "?");
|
||||
|
@@ -306,8 +306,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
||||
//av_log(NULL, AV_LOG_ERROR, "\n");
|
||||
}
|
||||
|
||||
p_x = (center_x - width / 2);
|
||||
p_y = (center_y - height / 2);
|
||||
p_x = (center_x - width / 2.0);
|
||||
p_y = (center_y - height / 2.0);
|
||||
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
||||
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
||||
|
||||
|
@@ -84,7 +84,7 @@ OBJS-$(CONFIG_AST_MUXER) += ast.o astenc.o
|
||||
OBJS-$(CONFIG_AU_DEMUXER) += au.o pcm.o
|
||||
OBJS-$(CONFIG_AU_MUXER) += au.o rawenc.o
|
||||
OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o
|
||||
OBJS-$(CONFIG_AVI_MUXER) += avienc.o
|
||||
OBJS-$(CONFIG_AVI_MUXER) += avienc.o avlanguage.o
|
||||
OBJS-$(CONFIG_AVISYNTH) += avisynth.o
|
||||
OBJS-$(CONFIG_AVM2_MUXER) += swfenc.o swf.o
|
||||
OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o
|
||||
|
@@ -237,7 +237,7 @@ static int aiff_read_header(AVFormatContext *s)
|
||||
break;
|
||||
case MKTAG('I', 'D', '3', ' '):
|
||||
position = avio_tell(pb);
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, size);
|
||||
if (id3v2_extra_meta)
|
||||
if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
|
||||
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
||||
|
@@ -266,7 +266,7 @@ static void get_id3_tag(AVFormatContext *s, int len)
|
||||
{
|
||||
ID3v2ExtraMeta *id3v2_extra_meta = NULL;
|
||||
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, len);
|
||||
if (id3v2_extra_meta)
|
||||
ff_id3v2_parse_apic(s, &id3v2_extra_meta);
|
||||
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
||||
|
@@ -611,6 +611,7 @@ static int asf_write_header(AVFormatContext *s)
|
||||
ASFContext *asf = s->priv_data;
|
||||
|
||||
s->packet_size = PACKET_SIZE;
|
||||
s->max_interleave_delta = 0;
|
||||
asf->nb_packets = 0;
|
||||
|
||||
asf->index_ptr = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);
|
||||
|
@@ -844,6 +844,12 @@ typedef struct AVStream {
|
||||
double (*duration_error)[2][MAX_STD_TIMEBASES];
|
||||
int64_t codec_info_duration;
|
||||
int64_t codec_info_duration_fields;
|
||||
|
||||
/**
|
||||
* 0 -> decoder has not been searched for yet.
|
||||
* >0 -> decoder found
|
||||
* <0 -> decoder with codec_id == -found_decoder has not been found
|
||||
*/
|
||||
int found_decoder;
|
||||
|
||||
int64_t last_duration;
|
||||
|
@@ -1315,7 +1315,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
AVIndexEntry *e;
|
||||
int index;
|
||||
|
||||
index = av_index_search_timestamp(st, ast->frame_offset, 0);
|
||||
index = av_index_search_timestamp(st, ast->frame_offset, AVSEEK_FLAG_ANY);
|
||||
e = &st->index_entries[index];
|
||||
|
||||
if (index >= 0 && e->timestamp == ast->frame_offset) {
|
||||
|
@@ -35,7 +35,7 @@ static int h263_probe(AVProbeData *p)
|
||||
for(i=0; i<p->buf_size; i++){
|
||||
code = (code<<8) + p->buf[i];
|
||||
if ((code & 0xfffffc0000) == 0x800000) {
|
||||
src_fmt= (code>>2)&3;
|
||||
src_fmt= (code>>2)&7;
|
||||
if( src_fmt != last_src_fmt
|
||||
&& last_src_fmt>0 && last_src_fmt<6
|
||||
&& src_fmt<6)
|
||||
|
@@ -878,16 +878,25 @@ error:
|
||||
|
||||
static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
|
||||
AVFormatContext *s, const char *magic,
|
||||
ID3v2ExtraMeta **extra_meta)
|
||||
ID3v2ExtraMeta **extra_meta, int64_t max_search_size)
|
||||
{
|
||||
int len, ret;
|
||||
uint8_t buf[ID3v2_HEADER_SIZE];
|
||||
int found_header;
|
||||
int64_t off;
|
||||
int64_t start, off;
|
||||
|
||||
if (max_search_size && max_search_size < ID3v2_HEADER_SIZE)
|
||||
return;
|
||||
|
||||
start = avio_tell(pb);
|
||||
do {
|
||||
/* save the current offset in case there's nothing to read/skip */
|
||||
off = avio_tell(pb);
|
||||
if (max_search_size && off - start >= max_search_size - ID3v2_HEADER_SIZE) {
|
||||
avio_seek(pb, off, SEEK_SET);
|
||||
break;
|
||||
}
|
||||
|
||||
ret = avio_read(pb, buf, ID3v2_HEADER_SIZE);
|
||||
if (ret != ID3v2_HEADER_SIZE) {
|
||||
avio_seek(pb, off, SEEK_SET);
|
||||
@@ -914,13 +923,13 @@ static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
|
||||
void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata,
|
||||
const char *magic, ID3v2ExtraMeta **extra_meta)
|
||||
{
|
||||
id3v2_read_internal(pb, metadata, NULL, magic, extra_meta);
|
||||
id3v2_read_internal(pb, metadata, NULL, magic, extra_meta, 0);
|
||||
}
|
||||
|
||||
void ff_id3v2_read(AVFormatContext *s, const char *magic,
|
||||
ID3v2ExtraMeta **extra_meta)
|
||||
ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
|
||||
{
|
||||
id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta);
|
||||
id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta, max_search_size);
|
||||
}
|
||||
|
||||
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
|
||||
@@ -935,6 +944,8 @@ void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
|
||||
av_freep(¤t);
|
||||
current = next;
|
||||
}
|
||||
|
||||
*extra_meta = NULL;
|
||||
}
|
||||
|
||||
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
|
||||
|
@@ -112,8 +112,10 @@ void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata, const char *ma
|
||||
*
|
||||
* @param extra_meta If not NULL, extra metadata is parsed into a list of
|
||||
* ID3v2ExtraMeta structs and *extra_meta points to the head of the list
|
||||
* @param[opt] max_search_search restrict ID3 magic number search (bytes from start)
|
||||
*/
|
||||
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
|
||||
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta,
|
||||
unsigned int max_search_size);
|
||||
|
||||
/**
|
||||
* Initialize an ID3v2 tag.
|
||||
|
@@ -35,7 +35,7 @@ const CodecTags ff_mkv_codec_tags[]={
|
||||
{"A_MPEG/L2" , AV_CODEC_ID_MP2},
|
||||
{"A_MPEG/L1" , AV_CODEC_ID_MP2},
|
||||
{"A_MPEG/L3" , AV_CODEC_ID_MP3},
|
||||
{"A_OPUS", AV_CODEC_ID_OPUS},
|
||||
{"A_OPUS" , AV_CODEC_ID_OPUS},
|
||||
{"A_OPUS/EXPERIMENTAL",AV_CODEC_ID_OPUS},
|
||||
{"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F32LE},
|
||||
{"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F64LE},
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/lzo.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/dict.h"
|
||||
#if CONFIG_ZLIB
|
||||
#include <zlib.h>
|
||||
@@ -164,12 +165,12 @@ typedef struct {
|
||||
uint64_t default_duration;
|
||||
uint64_t flag_default;
|
||||
uint64_t flag_forced;
|
||||
uint64_t codec_delay;
|
||||
uint64_t seek_preroll;
|
||||
MatroskaTrackVideo video;
|
||||
MatroskaTrackAudio audio;
|
||||
MatroskaTrackOperation operation;
|
||||
EbmlList encodings;
|
||||
uint64_t codec_delay;
|
||||
|
||||
AVStream *stream;
|
||||
int64_t end_timecode;
|
||||
@@ -404,6 +405,7 @@ static EbmlSyntax matroska_track[] = {
|
||||
{ MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack,type) },
|
||||
{ MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack,codec_id) },
|
||||
{ MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack,codec_priv) },
|
||||
{ MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack,codec_delay) },
|
||||
{ MATROSKA_ID_TRACKLANGUAGE, EBML_UTF8, 0, offsetof(MatroskaTrack,language), {.s="eng"} },
|
||||
{ MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack,default_duration) },
|
||||
{ MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT,0, offsetof(MatroskaTrack,time_scale), {.f=1.0} },
|
||||
@@ -414,7 +416,6 @@ static EbmlSyntax matroska_track[] = {
|
||||
{ MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack,operation), {.n=matroska_track_operation} },
|
||||
{ MATROSKA_ID_TRACKCONTENTENCODINGS,EBML_NEST, 0, 0, {.n=matroska_track_encodings} },
|
||||
{ MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack,max_block_additional_id) },
|
||||
{ MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack,codec_delay) },
|
||||
{ MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack,seek_preroll) },
|
||||
{ MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE },
|
||||
{ MATROSKA_ID_TRACKFLAGLACING, EBML_NONE },
|
||||
@@ -1852,6 +1853,11 @@ static int matroska_read_header(AVFormatContext *s)
|
||||
track->time_scale = 1.0;
|
||||
avpriv_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
|
||||
|
||||
/* convert the delay from ns to the track timebase */
|
||||
track->codec_delay = av_rescale_q(track->codec_delay,
|
||||
(AVRational){ 1, 1000000000 },
|
||||
st->time_base);
|
||||
|
||||
st->codec->codec_id = codec_id;
|
||||
|
||||
if (strcmp(track->language, "und"))
|
||||
@@ -1934,7 +1940,7 @@ static int matroska_read_header(AVFormatContext *s)
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
if (track->codec_delay > 0) {
|
||||
st->codec->delay = av_rescale_q(track->codec_delay,
|
||||
(AVRational){1, 1000000000},
|
||||
st->time_base,
|
||||
(AVRational){1, st->codec->sample_rate});
|
||||
}
|
||||
if (track->seek_preroll > 0) {
|
||||
@@ -2615,7 +2621,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
|
||||
if (cluster_time != (uint64_t)-1
|
||||
&& (block_time >= 0 || cluster_time >= -block_time)) {
|
||||
timecode = cluster_time + block_time;
|
||||
timecode = cluster_time + block_time - track->codec_delay;
|
||||
if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE
|
||||
&& timecode < track->end_timecode)
|
||||
is_keyframe = 0; /* overlapping subtitles are not key frame */
|
||||
|
@@ -116,15 +116,16 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
{
|
||||
MP3Context *mp3 = s->priv_data;
|
||||
AVCodecContext *codec = s->streams[mp3->audio_stream_idx]->codec;
|
||||
int bitrate_idx;
|
||||
int best_bitrate_idx = -1;
|
||||
int best_bitrate_error= INT_MAX;
|
||||
int xing_offset;
|
||||
int32_t header, mask;
|
||||
MPADecodeHeader c;
|
||||
int srate_idx, ver = 0, i, channels;
|
||||
int needed;
|
||||
const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
|
||||
int32_t header;
|
||||
MPADecodeHeader mpah;
|
||||
int srate_idx, i, channels;
|
||||
int bitrate_idx;
|
||||
int best_bitrate_idx = -1;
|
||||
int best_bitrate_error = INT_MAX;
|
||||
int xing_offset;
|
||||
int ver = 0;
|
||||
int bytes_needed, lsf;
|
||||
const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
|
||||
|
||||
if (!s->pb->seekable || !mp3->write_xing)
|
||||
return 0;
|
||||
@@ -156,28 +157,29 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
/* dummy MPEG audio header */
|
||||
header = 0xffU << 24; // sync
|
||||
header |= (0x7 << 5 | ver << 3 | 0x1 << 1 | 0x1) << 16; // sync/audio-version/layer 3/no crc*/
|
||||
header |= (srate_idx << 2) << 8;
|
||||
header |= (srate_idx << 2) << 8;
|
||||
header |= channels << 6;
|
||||
|
||||
for (bitrate_idx=1; bitrate_idx<15; bitrate_idx++) {
|
||||
int error;
|
||||
avpriv_mpegaudio_decode_header(&c, header | (bitrate_idx << (4+8)));
|
||||
error= FFABS(c.bit_rate - codec->bit_rate);
|
||||
if(error < best_bitrate_error){
|
||||
best_bitrate_error= error;
|
||||
best_bitrate_idx = bitrate_idx;
|
||||
for (bitrate_idx = 1; bitrate_idx < 15; bitrate_idx++) {
|
||||
int bit_rate = 1000 * avpriv_mpa_bitrate_tab[lsf][3 - 1][bitrate_idx];
|
||||
int error = FFABS(bit_rate - codec->bit_rate);
|
||||
|
||||
if (error < best_bitrate_error) {
|
||||
best_bitrate_error = error;
|
||||
best_bitrate_idx = bitrate_idx;
|
||||
}
|
||||
}
|
||||
av_assert0(best_bitrate_idx >= 0);
|
||||
|
||||
for (bitrate_idx= best_bitrate_idx;; bitrate_idx++) {
|
||||
for (bitrate_idx = best_bitrate_idx; ; bitrate_idx++) {
|
||||
int32_t mask = bitrate_idx << (4 + 8);
|
||||
if (15 == bitrate_idx)
|
||||
return -1;
|
||||
mask = bitrate_idx << (4+8);
|
||||
header |= mask;
|
||||
avpriv_mpegaudio_decode_header(&c, header);
|
||||
xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
||||
needed = 4 // header
|
||||
|
||||
avpriv_mpegaudio_decode_header(&mpah, header);
|
||||
xing_offset=xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1];
|
||||
bytes_needed = 4 // header
|
||||
+ xing_offset
|
||||
+ 4 // xing tag
|
||||
+ 4 // frames/size/toc flags
|
||||
@@ -187,8 +189,9 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
+ 24
|
||||
;
|
||||
|
||||
if (needed <= c.frame_size)
|
||||
if (bytes_needed <= mpah.frame_size)
|
||||
break;
|
||||
|
||||
header &= ~mask;
|
||||
}
|
||||
|
||||
@@ -199,7 +202,7 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
ffio_wfourcc(s->pb, "Xing");
|
||||
avio_wb32(s->pb, 0x01 | 0x02 | 0x04); // frames / size / TOC
|
||||
|
||||
mp3->size = c.frame_size;
|
||||
mp3->size = mpah.frame_size;
|
||||
mp3->want=1;
|
||||
mp3->seen=0;
|
||||
mp3->pos=0;
|
||||
@@ -217,7 +220,7 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
avio_w8(s->pb, 0);
|
||||
avio_wb24(s->pb, FFMAX(codec->delay - 528 - 1, 0)<<12);
|
||||
|
||||
ffio_fill(s->pb, 0, c.frame_size - needed);
|
||||
ffio_fill(s->pb, 0, mpah.frame_size - bytes_needed);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -257,7 +260,7 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
MP3Context *mp3 = s->priv_data;
|
||||
|
||||
if (pkt->data && pkt->size >= 4) {
|
||||
MPADecodeHeader c;
|
||||
MPADecodeHeader mpah;
|
||||
int av_unused base;
|
||||
uint32_t head = AV_RB32(pkt->data);
|
||||
|
||||
@@ -266,16 +269,16 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
"is invalid, writing it anyway.\n", pkt->size, head);
|
||||
return ff_raw_write_packet(s, pkt);
|
||||
}
|
||||
avpriv_mpegaudio_decode_header(&c, head);
|
||||
avpriv_mpegaudio_decode_header(&mpah, head);
|
||||
|
||||
if (!mp3->initial_bitrate)
|
||||
mp3->initial_bitrate = c.bit_rate;
|
||||
if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate))
|
||||
mp3->initial_bitrate = mpah.bit_rate;
|
||||
if ((mpah.bit_rate == 0) || (mp3->initial_bitrate != mpah.bit_rate))
|
||||
mp3->has_variable_bitrate = 1;
|
||||
|
||||
#ifdef FILTER_VBR_HEADERS
|
||||
/* filter out XING and INFO headers. */
|
||||
base = 4 + xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
||||
base = 4 + xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1];
|
||||
|
||||
if (base + 4 <= pkt->size) {
|
||||
uint32_t v = AV_RB32(pkt->data + base);
|
||||
|
@@ -1370,7 +1370,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_le
|
||||
AVStream *st;
|
||||
if (ts->pids[pid]->es_id != mp4_descr[i].es_id)
|
||||
continue;
|
||||
if (!(ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES)) {
|
||||
if (ts->pids[pid]->type != MPEGTS_PES) {
|
||||
av_log(s, AV_LOG_ERROR, "pid %x is not PES\n", pid);
|
||||
continue;
|
||||
}
|
||||
|
@@ -435,6 +435,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
||||
av_dlog(s, "compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
|
||||
av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), delay, pkt->size, pkt->stream_index);
|
||||
|
||||
if (pkt->duration < 0 && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
|
||||
av_log(s, AV_LOG_WARNING, "Packet with invalid duration %d in stream %d\n",
|
||||
pkt->duration, pkt->stream_index);
|
||||
pkt->duration = 0;
|
||||
}
|
||||
|
||||
/* duration field */
|
||||
if (pkt->duration == 0) {
|
||||
ff_compute_frame_duration(&num, &den, st, NULL, pkt);
|
||||
|
@@ -293,7 +293,7 @@ static int oma_read_header(AVFormatContext *s)
|
||||
ID3v2ExtraMeta *extra_meta = NULL;
|
||||
OMAContext *oc = s->priv_data;
|
||||
|
||||
ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta, 0);
|
||||
ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
|
||||
if (ret < EA3_HEADER_SIZE)
|
||||
return -1;
|
||||
|
@@ -160,10 +160,6 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
ret = av_get_packet(pb, pkt, pmp->packet_sizes[pmp->current_packet]);
|
||||
if (ret >= 0) {
|
||||
ret = 0;
|
||||
// FIXME: this is a hack that should be removed once
|
||||
// compute_pkt_fields() can handle timestamps properly
|
||||
if (pmp->cur_stream == 0)
|
||||
pkt->dts = s->streams[0]->cur_dts++;
|
||||
pkt->stream_index = pmp->cur_stream;
|
||||
}
|
||||
if (pmp->current_packet % pmp->audio_packets == 0)
|
||||
|
@@ -150,6 +150,8 @@ static const uint8_t rtmp_server_key[] = {
|
||||
0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
|
||||
};
|
||||
|
||||
static int handle_chunk_size(URLContext *s, RTMPPacket *pkt);
|
||||
|
||||
static int add_tracked_method(RTMPContext *rt, const char *name, int id)
|
||||
{
|
||||
int err;
|
||||
@@ -408,6 +410,17 @@ static int read_connect(URLContext *s, RTMPContext *rt)
|
||||
if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
|
||||
&rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
|
||||
return ret;
|
||||
|
||||
if (pkt.type == RTMP_PT_CHUNK_SIZE) {
|
||||
if ((ret = handle_chunk_size(s, &pkt)) < 0)
|
||||
return ret;
|
||||
|
||||
ff_rtmp_packet_destroy(&pkt);
|
||||
if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
|
||||
&rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
cp = pkt.data;
|
||||
bytestream2_init(&gbc, cp, pkt.size);
|
||||
if (ff_amf_read_string(&gbc, command, sizeof(command), &stringlen)) {
|
||||
@@ -2556,7 +2569,7 @@ reconnect:
|
||||
if ((ret = gen_connect(s, rt)) < 0)
|
||||
goto fail;
|
||||
} else {
|
||||
if (read_connect(s, s->priv_data) < 0)
|
||||
if ((ret = read_connect(s, s->priv_data)) < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@@ -564,7 +564,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename,
|
||||
|
||||
/* e.g. AVFMT_NOFILE formats will not have a AVIOContext */
|
||||
if (s->pb)
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, 0);
|
||||
|
||||
if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->iformat->read_header)
|
||||
if ((ret = s->iformat->read_header(s)) < 0)
|
||||
@@ -2623,13 +2623,15 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
|
||||
if (!frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (!avcodec_is_open(st->codec) && !st->info->found_decoder) {
|
||||
if (!avcodec_is_open(st->codec) &&
|
||||
st->info->found_decoder <= 0 &&
|
||||
(st->codec->codec_id != -st->info->found_decoder || !st->codec->codec_id)) {
|
||||
AVDictionary *thread_opt = NULL;
|
||||
|
||||
codec = find_decoder(s, st, st->codec->codec_id);
|
||||
|
||||
if (!codec) {
|
||||
st->info->found_decoder = -1;
|
||||
st->info->found_decoder = -st->codec->codec_id;
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
@@ -2641,7 +2643,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
|
||||
if (!options)
|
||||
av_dict_free(&thread_opt);
|
||||
if (ret < 0) {
|
||||
st->info->found_decoder = -1;
|
||||
st->info->found_decoder = -st->codec->codec_id;
|
||||
goto fail;
|
||||
}
|
||||
st->info->found_decoder = 1;
|
||||
|
@@ -189,7 +189,7 @@ int avresample_open(AVAudioResampleContext *avr)
|
||||
}
|
||||
if (avr->resample_needed) {
|
||||
avr->resample_out_buffer = ff_audio_data_alloc(avr->out_channels,
|
||||
0, avr->internal_sample_fmt,
|
||||
1024, avr->internal_sample_fmt,
|
||||
"resample_out_buffer");
|
||||
if (!avr->resample_out_buffer) {
|
||||
ret = AVERROR(EINVAL);
|
||||
|
@@ -331,15 +331,15 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
|
||||
while (code & top) {
|
||||
int tmp;
|
||||
if (p >= buf_end) {
|
||||
ret = AVERROR(EILSEQ); /* incomplete sequence */
|
||||
goto end;
|
||||
(*bufp) ++;
|
||||
return AVERROR(EILSEQ); /* incomplete sequence */
|
||||
}
|
||||
|
||||
/* we assume the byte to be in the form 10xx-xxxx */
|
||||
tmp = *p++ - 128; /* strip leading 1 */
|
||||
if (tmp>>6) {
|
||||
ret = AVERROR(EILSEQ);
|
||||
goto end;
|
||||
(*bufp) ++;
|
||||
return AVERROR(EILSEQ);
|
||||
}
|
||||
code = (code<<6) + tmp;
|
||||
top <<= 5;
|
||||
|
@@ -127,6 +127,11 @@ av_cold static int auto_matrix(SwrContext *s)
|
||||
)
|
||||
out_ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
if( in_ch_layout == AV_CH_LAYOUT_STEREO_DOWNMIX
|
||||
&& (out_ch_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == 0
|
||||
)
|
||||
in_ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
if(!sane_layout(in_ch_layout)){
|
||||
av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
|
||||
av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);
|
||||
|
@@ -922,7 +922,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
|
||||
uint8_t *dst2[4];
|
||||
uint8_t *rgb0_tmp = NULL;
|
||||
|
||||
if (!srcSlice || !dstStride || !dst || !srcSlice) {
|
||||
if (!srcStride || !dstStride || !dst || !srcSlice) {
|
||||
av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1585,7 +1585,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
|
||||
c->swscale = ff_yuv2rgb_get_func_ptr(c);
|
||||
}
|
||||
|
||||
if (srcFormat == AV_PIX_FMT_YUV410P &&
|
||||
if (srcFormat == AV_PIX_FMT_YUV410P && !(dstH & 3) &&
|
||||
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
|
||||
!(flags & SWS_BITEXACT)) {
|
||||
c->swscale = yvu9ToYv12Wrapper;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
pkt_pts=1620|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=4140|tag:lavfi.scene_score=0.880000
|
||||
pkt_pts=4140|tag:lavfi.scene_score=0.876043
|
||||
pkt_pts=5800|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=6720|tag:lavfi.scene_score=0.460000
|
||||
pkt_pts=6720|tag:lavfi.scene_score=0.463259
|
||||
pkt_pts=8160|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=9760|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=14080|tag:lavfi.scene_score=0.840000
|
||||
pkt_pts=14080|tag:lavfi.scene_score=0.841420
|
||||
pkt_pts=15700|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=18500|tag:lavfi.scene_score=0.470000
|
||||
pkt_pts=18500|tag:lavfi.scene_score=0.471738
|
||||
pkt_pts=21760|tag:lavfi.scene_score=1.000000
|
||||
|
@@ -1,31 +1,31 @@
|
||||
#tb 0: 1/25
|
||||
0, 0, 0, 1, 518400, 0x89407f55
|
||||
0, 2, 2, 1, 518400, 0x8611849c
|
||||
0, 2, 2, 1, 518400, 0xaa896afd
|
||||
0, 3, 3, 1, 518400, 0x0e69ff59
|
||||
0, 4, 4, 1, 518400, 0xf31adb03
|
||||
0, 4, 4, 1, 518400, 0x0c30bfa0
|
||||
0, 5, 5, 1, 518400, 0x1a5b6a69
|
||||
0, 6, 6, 1, 518400, 0x6ae6232e
|
||||
0, 6, 6, 1, 518400, 0x23470858
|
||||
0, 7, 7, 1, 518400, 0x9a4e3c54
|
||||
0, 8, 8, 1, 518400, 0xe5852b45
|
||||
0, 8, 8, 1, 518400, 0xad63160b
|
||||
0, 9, 9, 1, 518400, 0x0fcfeebc
|
||||
0, 10, 10, 1, 518400, 0x06e22dc3
|
||||
0, 10, 10, 1, 518400, 0x20b31777
|
||||
0, 11, 11, 1, 518400, 0x9d79df09
|
||||
0, 12, 12, 1, 518400, 0xcb2c716f
|
||||
0, 12, 12, 1, 518400, 0x3e86766f
|
||||
0, 13, 13, 1, 518400, 0x638a8746
|
||||
0, 14, 14, 1, 518400, 0xf7032efd
|
||||
0, 14, 14, 1, 518400, 0x7a6c1a0e
|
||||
0, 15, 15, 1, 518400, 0x306f6cef
|
||||
0, 16, 16, 1, 518400, 0xe83d2518
|
||||
0, 16, 16, 1, 518400, 0x81f81281
|
||||
0, 17, 17, 1, 518400, 0x49ab5bf5
|
||||
0, 18, 18, 1, 518400, 0x6b336b6f
|
||||
0, 18, 18, 1, 518400, 0x8f316e44
|
||||
0, 19, 19, 1, 518400, 0x95ae00c9
|
||||
0, 20, 20, 1, 518400, 0x68ddb64f
|
||||
0, 20, 20, 1, 518400, 0xf71bb7f5
|
||||
0, 21, 21, 1, 518400, 0x5205ea68
|
||||
0, 22, 22, 1, 518400, 0xb088e617
|
||||
0, 22, 22, 1, 518400, 0x74a1d8b9
|
||||
0, 23, 23, 1, 518400, 0xa3217616
|
||||
0, 24, 24, 1, 518400, 0x1723bc53
|
||||
0, 24, 24, 1, 518400, 0x2b28bbf8
|
||||
0, 25, 25, 1, 518400, 0xf024872a
|
||||
0, 26, 26, 1, 518400, 0x2e81a8bb
|
||||
0, 26, 26, 1, 518400, 0x2fdbaaf3
|
||||
0, 27, 27, 1, 518400, 0xa3a2418e
|
||||
0, 28, 28, 1, 518400, 0xb7beffed
|
||||
0, 28, 28, 1, 518400, 0x55bfe435
|
||||
0, 29, 29, 1, 518400, 0x50fb6c94
|
||||
0, 30, 30, 1, 518400, 0x5584bb40
|
||||
|
Reference in New Issue
Block a user