mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-19 12:31:22 +01:00
Compare commits
12 Commits
n3.1.11
...
release/3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29584733e6 | ||
|
|
526628058e | ||
|
|
24b4c4c5ba | ||
|
|
6f6cd2e29d | ||
|
|
f8e254716b | ||
|
|
7653e8db4d | ||
|
|
a9c1ef2626 | ||
|
|
ac1ddc6361 | ||
|
|
86d6fca94b | ||
|
|
13deb0c1f6 | ||
|
|
da11322641 | ||
|
|
7cce800930 |
@@ -58,6 +58,9 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; bitstream_filters[i]; i++) {
|
||||
const AVBitStreamFilter *f = bitstream_filters[i];
|
||||
if (!strcmp(f->name, name))
|
||||
|
||||
@@ -2792,6 +2792,10 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
|
||||
}
|
||||
|
||||
if (s->sh.first_slice_in_pic_flag) {
|
||||
if (s->ref) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n");
|
||||
goto fail;
|
||||
}
|
||||
ret = hevc_frame_start(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@@ -362,7 +362,6 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
// Check if subtraction resulted in an overflow
|
||||
if ((discard_padding < opus->opts.packet_size) != (avpkt->duration > 0)) {
|
||||
av_packet_unref(avpkt);
|
||||
av_free(avpkt);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (discard_padding > 0) {
|
||||
@@ -371,7 +370,6 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
10);
|
||||
if(!side_data) {
|
||||
av_packet_unref(avpkt);
|
||||
av_free(avpkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
AV_WL32(side_data + 4, discard_padding);
|
||||
|
||||
@@ -805,7 +805,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
cx_frame->sz_alpha + 8);
|
||||
if(!side_data) {
|
||||
av_packet_unref(pkt);
|
||||
av_free(pkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
AV_WB64(side_data, 1);
|
||||
|
||||
@@ -1193,7 +1193,8 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx)
|
||||
/* DWT init */
|
||||
if (ff_vc2enc_init_transforms(&s->transform_args[i].t,
|
||||
s->plane[i].coef_stride,
|
||||
s->plane[i].dwt_height))
|
||||
s->plane[i].dwt_height,
|
||||
s->slice_width, s->slice_height))
|
||||
goto alloc_fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -255,21 +255,27 @@ static void vc2_subband_dwt_haar_shift(VC2TransformContext *t, dwtcoef *data,
|
||||
dwt_haar(t, data, stride, width, height, 1);
|
||||
}
|
||||
|
||||
av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)
|
||||
av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_stride,
|
||||
int p_height, int slice_w, int slice_h)
|
||||
{
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_9_7] = vc2_subband_dwt_97;
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_5_3] = vc2_subband_dwt_53;
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_HAAR] = vc2_subband_dwt_haar;
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_HAAR_S] = vc2_subband_dwt_haar_shift;
|
||||
|
||||
s->buffer = av_malloc(2*p_width*p_height*sizeof(dwtcoef));
|
||||
/* Pad by the slice size, only matters for non-Haar wavelets */
|
||||
s->buffer = av_calloc((p_stride + slice_w)*(p_height + slice_h), sizeof(dwtcoef));
|
||||
if (!s->buffer)
|
||||
return 1;
|
||||
|
||||
s->padding = (slice_h >> 1)*p_stride + (slice_w >> 1);
|
||||
s->buffer += s->padding;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
av_cold void ff_vc2enc_free_transforms(VC2TransformContext *s)
|
||||
{
|
||||
av_freep(&s->buffer);
|
||||
av_free(s->buffer - s->padding);
|
||||
s->buffer = NULL;
|
||||
}
|
||||
|
||||
@@ -41,12 +41,14 @@ enum VC2TransformType {
|
||||
|
||||
typedef struct VC2TransformContext {
|
||||
dwtcoef *buffer;
|
||||
int padding;
|
||||
void (*vc2_subband_dwt[VC2_TRANSFORMS_NB])(struct VC2TransformContext *t,
|
||||
dwtcoef *data, ptrdiff_t stride,
|
||||
int width, int height);
|
||||
} VC2TransformContext;
|
||||
|
||||
int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_width, int p_height);
|
||||
int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_stride, int p_height,
|
||||
int slice_w, int slice_h);
|
||||
void ff_vc2enc_free_transforms(VC2TransformContext *t);
|
||||
|
||||
#endif /* AVCODEC_VC2ENC_DWT_H */
|
||||
|
||||
@@ -118,14 +118,16 @@ static int iec61883_callback(unsigned char *data, int length,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
packet->buf = av_malloc(length);
|
||||
packet->buf = av_malloc(length + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!packet->buf) {
|
||||
av_free(packet);
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
packet->len = length;
|
||||
|
||||
memcpy(packet->buf, data, length);
|
||||
memset(packet->buf + length, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
if (dv->queue_first) {
|
||||
dv->queue_last->next = packet;
|
||||
@@ -199,13 +201,21 @@ static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)
|
||||
size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
|
||||
packet->buf, packet->len, -1);
|
||||
dv->queue_first = packet->next;
|
||||
if (size < 0)
|
||||
av_free(packet->buf);
|
||||
av_free(packet);
|
||||
dv->packets--;
|
||||
|
||||
if (size > 0)
|
||||
return size;
|
||||
if (size < 0)
|
||||
return -1;
|
||||
|
||||
return -1;
|
||||
if (av_packet_from_data(pkt, pkt->data, pkt->size) < 0) {
|
||||
av_freep(&pkt->data);
|
||||
av_packet_unref(pkt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
|
||||
@@ -453,6 +463,7 @@ static int iec61883_close(AVFormatContext *context)
|
||||
} else {
|
||||
iec61883_dv_fb_stop(dv->iec61883_dv);
|
||||
iec61883_dv_fb_close(dv->iec61883_dv);
|
||||
av_freep(&dv->dv_demux);
|
||||
}
|
||||
while (dv->queue_first) {
|
||||
DVPacket *packet = dv->queue_first;
|
||||
|
||||
@@ -186,8 +186,17 @@ static int config_input(AVFilterLink *inlink)
|
||||
|
||||
s->start_duration = av_rescale(s->start_duration, inlink->sample_rate,
|
||||
AV_TIME_BASE);
|
||||
if (s->start_duration < 0) {
|
||||
av_log(ctx, AV_LOG_WARNING, "start duration must be non-negative\n");
|
||||
s->start_duration = -s->start_duration;
|
||||
}
|
||||
|
||||
s->stop_duration = av_rescale(s->stop_duration, inlink->sample_rate,
|
||||
AV_TIME_BASE);
|
||||
if (s->stop_duration < 0) {
|
||||
av_log(ctx, AV_LOG_WARNING, "stop duration must be non-negative\n");
|
||||
s->stop_duration = -s->stop_duration;
|
||||
}
|
||||
|
||||
s->start_holdoff = av_malloc_array(FFMAX(s->start_duration, 1),
|
||||
sizeof(*s->start_holdoff) *
|
||||
|
||||
@@ -103,7 +103,7 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user
|
||||
}
|
||||
}
|
||||
|
||||
if (!authorized && (auth_methods & SSH_AUTH_METHOD_PASSWORD)) {
|
||||
if (!authorized && password && (auth_methods & SSH_AUTH_METHOD_PASSWORD)) {
|
||||
if (ssh_userauth_password(libssh->session, NULL, password) == SSH_AUTH_SUCCESS) {
|
||||
av_log(libssh, AV_LOG_DEBUG, "Authentication successful with password.\n");
|
||||
authorized = 1;
|
||||
|
||||
@@ -660,7 +660,7 @@ static const EbmlSyntax matroska_segments[] = {
|
||||
};
|
||||
|
||||
static const EbmlSyntax matroska_blockmore[] = {
|
||||
{ MATROSKA_ID_BLOCKADDID, EBML_UINT, 0, offsetof(MatroskaBlock,additional_id) },
|
||||
{ MATROSKA_ID_BLOCKADDID, EBML_UINT, 0, offsetof(MatroskaBlock,additional_id), { .u = 1 } },
|
||||
{ MATROSKA_ID_BLOCKADDITIONAL, EBML_BIN, 0, offsetof(MatroskaBlock,additional) },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
|
||||
* The situation is undefined according to POSIX and may crash with
|
||||
* some libc implementations.
|
||||
*/
|
||||
av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
|
||||
int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
|
||||
|
||||
/**
|
||||
* Free a memory block which has been allocated with av_malloc(z)() or
|
||||
|
||||
Reference in New Issue
Block a user