Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4dfd4399ea | ||
![]() |
f0d56d4f55 | ||
![]() |
71a4a9183f | ||
![]() |
80588930ff | ||
![]() |
bd2266975c | ||
![]() |
e68114868f | ||
![]() |
4533e8b30a | ||
![]() |
a8dd7fe5b9 | ||
![]() |
503322f97c | ||
![]() |
574bf2ce4c | ||
![]() |
1f2f6b247a | ||
![]() |
724deeb7a8 | ||
![]() |
62899d79a3 | ||
![]() |
45283653a3 | ||
![]() |
6af1793dd5 | ||
![]() |
4310ba273d | ||
![]() |
ba8ab4e7ae | ||
![]() |
e0fcad7761 | ||
![]() |
9455a023be |
@@ -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 = 1.1.11
|
||||
PROJECT_NUMBER = 1.1.12
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
34
ffmpeg.c
34
ffmpeg.c
@@ -578,6 +578,25 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
bsfc = bsfc->next;
|
||||
}
|
||||
|
||||
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
|
||||
ost->last_mux_dts != AV_NOPTS_VALUE &&
|
||||
pkt->dts < ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT)) {
|
||||
av_log(NULL, AV_LOG_WARNING, "Non-monotonous DTS in output stream "
|
||||
"%d:%d; previous: %"PRId64", current: %"PRId64"; ",
|
||||
ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
|
||||
if (exit_on_error) {
|
||||
av_log(NULL, AV_LOG_FATAL, "aborting.\n");
|
||||
exit(1);
|
||||
}
|
||||
av_log(NULL, AV_LOG_WARNING, "changing to %"PRId64". This may result "
|
||||
"in incorrect timestamps in the output file.\n",
|
||||
ost->last_mux_dts + 1);
|
||||
pkt->dts = ost->last_mux_dts + 1;
|
||||
if (pkt->pts != AV_NOPTS_VALUE)
|
||||
pkt->pts = FFMAX(pkt->pts, pkt->dts);
|
||||
}
|
||||
ost->last_mux_dts = pkt->dts;
|
||||
|
||||
pkt->stream_index = ost->index;
|
||||
|
||||
if (debug_ts) {
|
||||
@@ -996,6 +1015,19 @@ static void do_video_stats(OutputStream *ost, int frame_size)
|
||||
}
|
||||
}
|
||||
|
||||
static void finish_output_stream(OutputStream *ost)
|
||||
{
|
||||
OutputFile *of = output_files[ost->file_index];
|
||||
int i;
|
||||
|
||||
ost->finished = 1;
|
||||
|
||||
if (of->shortest) {
|
||||
for (i = 0; i < of->ctx->nb_streams; i++)
|
||||
output_streams[of->ost_index + i]->finished = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get and encode new output from any of the filtergraphs, without causing
|
||||
* activity.
|
||||
@@ -2764,7 +2796,7 @@ static int process_input(int file_index)
|
||||
|
||||
if (ost->source_index == ifile->ist_index + i &&
|
||||
(ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
|
||||
close_output_stream(ost);
|
||||
finish_output_stream(ost);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
ffmpeg.h
2
ffmpeg.h
@@ -300,6 +300,8 @@ typedef struct OutputStream {
|
||||
/* pts of the first frame encoded for this stream, used for limiting
|
||||
* recording time */
|
||||
int64_t first_pts;
|
||||
/* dts of the last packet sent to the muxer */
|
||||
int64_t last_mux_dts;
|
||||
AVBitStreamFilterContext *bitstream_filters;
|
||||
AVCodec *enc;
|
||||
int64_t max_frames;
|
||||
|
@@ -1021,6 +1021,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
input_streams[source_index]->discard = 0;
|
||||
input_streams[source_index]->st->discard = AVDISCARD_NONE;
|
||||
}
|
||||
ost->last_mux_dts = AV_NOPTS_VALUE;
|
||||
|
||||
return ost;
|
||||
}
|
||||
|
@@ -285,7 +285,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
|
||||
GetBitContext gb;
|
||||
uint64_t ht_size;
|
||||
int i, config_offset;
|
||||
MPEG4AudioConfig m4ac;
|
||||
MPEG4AudioConfig m4ac = {0};
|
||||
ALSSpecificConfig *sconf = &ctx->sconf;
|
||||
AVCodecContext *avctx = ctx->avctx;
|
||||
uint32_t als_id, header_size, trailer_size;
|
||||
|
@@ -200,6 +200,7 @@ typedef struct DiracContext {
|
||||
|
||||
uint16_t *mctmp; /* buffer holding the MC data multipled by OBMC weights */
|
||||
uint8_t *mcscratch;
|
||||
int buffer_stride;
|
||||
|
||||
DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE];
|
||||
|
||||
@@ -342,22 +343,44 @@ static int alloc_sequence_buffers(DiracContext *s)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
w = s->source.width;
|
||||
h = s->source.height;
|
||||
|
||||
/* fixme: allocate using real stride here */
|
||||
s->sbsplit = av_malloc(sbwidth * sbheight);
|
||||
s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
|
||||
s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
|
||||
s->sbsplit = av_malloc_array(sbwidth, sbheight);
|
||||
s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
|
||||
|
||||
s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
|
||||
s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
|
||||
|
||||
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
|
||||
if (!s->sbsplit || !s->blmotion)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int alloc_buffers(DiracContext *s, int stride)
|
||||
{
|
||||
int w = s->source.width;
|
||||
int h = s->source.height;
|
||||
|
||||
av_assert0(stride >= w);
|
||||
stride += 64;
|
||||
|
||||
if (s->buffer_stride >= stride)
|
||||
return 0;
|
||||
s->buffer_stride = 0;
|
||||
|
||||
av_freep(&s->edge_emu_buffer_base);
|
||||
memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer));
|
||||
av_freep(&s->mctmp);
|
||||
av_freep(&s->mcscratch);
|
||||
|
||||
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
|
||||
|
||||
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
|
||||
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
|
||||
|
||||
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
s->buffer_stride = stride;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_sequence_buffers(DiracContext *s)
|
||||
{
|
||||
int i, j, k;
|
||||
@@ -381,6 +404,7 @@ static void free_sequence_buffers(DiracContext *s)
|
||||
av_freep(&s->plane[i].idwt_tmp);
|
||||
}
|
||||
|
||||
s->buffer_stride = 0;
|
||||
av_freep(&s->sbsplit);
|
||||
av_freep(&s->blmotion);
|
||||
av_freep(&s->edge_emu_buffer_base);
|
||||
@@ -1817,6 +1841,9 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
|
||||
s->plane[1].stride = pic->avframe.linesize[1];
|
||||
s->plane[2].stride = pic->avframe.linesize[2];
|
||||
|
||||
if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
|
||||
if (dirac_decode_picture_header(s))
|
||||
return -1;
|
||||
|
@@ -362,7 +362,8 @@ static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
avctx->delay = duration;
|
||||
av_assert0(!s->afq.remaining_delay);
|
||||
s->afq.frames->duration += duration;
|
||||
s->afq.frames->pts -= duration;
|
||||
if (s->afq.frames->pts != AV_NOPTS_VALUE)
|
||||
s->afq.frames->pts -= duration;
|
||||
s->afq.remaining_samples += duration;
|
||||
}
|
||||
ff_af_queue_remove(&s->afq, duration, &avpkt->pts, &avpkt->duration);
|
||||
|
@@ -249,6 +249,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
static av_cold int sgi_init(AVCodecContext *avctx){
|
||||
SgiState *s = avctx->priv_data;
|
||||
|
||||
s->avctx = avctx;
|
||||
|
||||
avcodec_get_frame_defaults(&s->picture);
|
||||
avctx->coded_frame = &s->picture;
|
||||
|
||||
@@ -265,15 +267,6 @@ static av_cold int sgi_end(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int sgi_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
SgiState *s = avctx->priv_data;
|
||||
|
||||
s->avctx = avctx;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec ff_sgi_decoder = {
|
||||
.name = "sgi",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
@@ -283,6 +276,5 @@ AVCodec ff_sgi_decoder = {
|
||||
.close = sgi_end,
|
||||
.decode = decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
|
||||
.init = sgi_decode_init,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
};
|
||||
|
@@ -218,6 +218,18 @@ static int flv_write_header(AVFormatContext *s)
|
||||
avcodec_get_name(enc->codec_id), i);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (enc->codec_id == AV_CODEC_ID_MPEG4 ||
|
||||
enc->codec_id == AV_CODEC_ID_H263) {
|
||||
int error = enc->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL;
|
||||
av_log(s, error ? AV_LOG_ERROR : AV_LOG_WARNING,
|
||||
"Codec %s is not supported in the official FLV specification,\n", avcodec_get_name(enc->codec_id));
|
||||
|
||||
if (error) {
|
||||
av_log(s, AV_LOG_ERROR,
|
||||
"use vstrict=-1 / -strict -1 to use it anyway.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
audio_enc = enc;
|
||||
|
@@ -95,6 +95,8 @@ typedef struct MatroskaMuxContext {
|
||||
AVPacket cur_audio_pkt;
|
||||
|
||||
int have_attachments;
|
||||
|
||||
int64_t ts_offset;
|
||||
} MatroskaMuxContext;
|
||||
|
||||
|
||||
@@ -1265,9 +1267,18 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
AVIOContext *pb = s->pb->seekable ? s->pb : mkv->dyn_bc;
|
||||
AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
|
||||
int ret, keyframe = !!(pkt->flags & AV_PKT_FLAG_KEY);
|
||||
int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
|
||||
int64_t ts;
|
||||
int cluster_size = avio_tell(pb) - (s->pb->seekable ? mkv->cluster_pos : 0);
|
||||
|
||||
if (pkt->dts < 0 && !mkv->ts_offset)
|
||||
mkv->ts_offset = -pkt->dts;
|
||||
|
||||
pkt->dts += mkv->ts_offset;
|
||||
if (pkt->pts != AV_NOPTS_VALUE)
|
||||
pkt->pts += mkv->ts_offset;
|
||||
|
||||
ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
|
||||
|
||||
// start a new cluster every 5 MB or 5 sec, or 32k / 1 sec for streaming or
|
||||
// after 4k and on a keyframe
|
||||
if (mkv->cluster_pos != -1 &&
|
||||
|
@@ -153,7 +153,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
}
|
||||
c->curbits = (curbits + size2) & 0x1F;
|
||||
|
||||
if ((ret = av_new_packet(pkt, size)) < 0)
|
||||
if ((ret = av_new_packet(pkt, size + 4)) < 0)
|
||||
return ret;
|
||||
|
||||
pkt->data[0] = curbits;
|
||||
|
@@ -23,6 +23,24 @@
|
||||
static int flags, checked;
|
||||
|
||||
void av_force_cpu_flags(int arg){
|
||||
if ( (arg & ( AV_CPU_FLAG_3DNOW |
|
||||
AV_CPU_FLAG_3DNOWEXT |
|
||||
AV_CPU_FLAG_SSE |
|
||||
AV_CPU_FLAG_SSE2 |
|
||||
AV_CPU_FLAG_SSE2SLOW |
|
||||
AV_CPU_FLAG_SSE3 |
|
||||
AV_CPU_FLAG_SSE3SLOW |
|
||||
AV_CPU_FLAG_SSSE3 |
|
||||
AV_CPU_FLAG_SSE4 |
|
||||
AV_CPU_FLAG_SSE42 |
|
||||
AV_CPU_FLAG_AVX |
|
||||
AV_CPU_FLAG_XOP |
|
||||
AV_CPU_FLAG_FMA4 ))
|
||||
&& !(arg & AV_CPU_FLAG_MMX)) {
|
||||
av_log(NULL, AV_LOG_WARNING, "MMX implied by specified flags\n");
|
||||
arg |= AV_CPU_FLAG_MMX;
|
||||
}
|
||||
|
||||
flags = arg;
|
||||
checked = arg != -1;
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "avutil.h"
|
||||
#include "avassert.h"
|
||||
#include "common.h"
|
||||
#include "intreadwrite.h"
|
||||
#include "lzo.h"
|
||||
@@ -65,8 +66,13 @@ static inline int get_len(LZOContext *c, int x, int mask)
|
||||
{
|
||||
int cnt = x & mask;
|
||||
if (!cnt) {
|
||||
while (!(x = get_byte(c)))
|
||||
while (!(x = get_byte(c))) {
|
||||
if (cnt >= INT_MAX - 1000) {
|
||||
c->error |= AV_LZO_ERROR;
|
||||
break;
|
||||
}
|
||||
cnt += 255;
|
||||
}
|
||||
cnt += mask + x;
|
||||
}
|
||||
return cnt;
|
||||
@@ -80,6 +86,7 @@ static inline void copy(LZOContext *c, int cnt)
|
||||
{
|
||||
register const uint8_t *src = c->in;
|
||||
register uint8_t *dst = c->out;
|
||||
av_assert0(cnt >= 0);
|
||||
if (cnt > c->in_end - src) {
|
||||
cnt = FFMAX(c->in_end - src, 0);
|
||||
c->error |= AV_LZO_INPUT_DEPLETED;
|
||||
@@ -103,7 +110,7 @@ static inline void copy(LZOContext *c, int cnt)
|
||||
/**
|
||||
* @brief Copies previously decoded bytes to current position.
|
||||
* @param back how many bytes back we start, must be > 0
|
||||
* @param cnt number of bytes to copy, must be >= 0
|
||||
* @param cnt number of bytes to copy, must be > 0
|
||||
*
|
||||
* cnt > back is valid, this will copy the bytes we just copied,
|
||||
* thus creating a repeating pattern with a period length of back.
|
||||
@@ -111,6 +118,7 @@ static inline void copy(LZOContext *c, int cnt)
|
||||
static inline void copy_backptr(LZOContext *c, int back, int cnt)
|
||||
{
|
||||
register uint8_t *dst = c->out;
|
||||
av_assert0(cnt > 0);
|
||||
if (dst - c->out_start < back) {
|
||||
c->error |= AV_LZO_INVALID_BACKPTR;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user