mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: lavfi/af_asetnsamples: fix EOF handling. lavu/opt: make sure av_opt_set_bin() handles NULL/0. lavd/v4l2: fully init an ioctl argument. lavfi: detect merge failure for unknown layouts. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
599866f5d5
@ -949,11 +949,10 @@ static int v4l2_read_header(AVFormatContext *s1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!s->width && !s->height) {
|
if (!s->width && !s->height) {
|
||||||
struct v4l2_format fmt;
|
struct v4l2_format fmt = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
|
||||||
|
|
||||||
av_log(s1, AV_LOG_VERBOSE,
|
av_log(s1, AV_LOG_VERBOSE,
|
||||||
"Querying the device for the current frame size\n");
|
"Querying the device for the current frame size\n");
|
||||||
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
|
||||||
if (v4l2_ioctl(s->fd, VIDIOC_G_FMT, &fmt) < 0) {
|
if (v4l2_ioctl(s->fd, VIDIOC_G_FMT, &fmt) < 0) {
|
||||||
res = AVERROR(errno);
|
res = AVERROR(errno);
|
||||||
av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_FMT): %s\n", av_err2str(res));
|
av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_FMT): %s\n", av_err2str(res));
|
||||||
|
@ -171,9 +171,8 @@ static int request_frame(AVFilterLink *outlink)
|
|||||||
} while (!asns->req_fullfilled && ret >= 0);
|
} while (!asns->req_fullfilled && ret >= 0);
|
||||||
|
|
||||||
if (ret == AVERROR_EOF) {
|
if (ret == AVERROR_EOF) {
|
||||||
do {
|
ret = push_samples(outlink);
|
||||||
ret = push_samples(outlink);
|
return ret < 0 ? ret : ret > 0 ? 0 : AVERROR_EOF;
|
||||||
} while (ret > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -184,6 +184,10 @@ AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
|
|||||||
for (i = j = 0; i < b->nb_channel_layouts; i++)
|
for (i = j = 0; i < b->nb_channel_layouts; i++)
|
||||||
if (KNOWN(b->channel_layouts[i]))
|
if (KNOWN(b->channel_layouts[i]))
|
||||||
b->channel_layouts[j++] = b->channel_layouts[i];
|
b->channel_layouts[j++] = b->channel_layouts[i];
|
||||||
|
/* Not optimal: the unknown layouts of b may become known after
|
||||||
|
another merge. */
|
||||||
|
if (!j)
|
||||||
|
return NULL;
|
||||||
b->nb_channel_layouts = j;
|
b->nb_channel_layouts = j;
|
||||||
}
|
}
|
||||||
MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail);
|
MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail);
|
||||||
|
@ -420,8 +420,8 @@ int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int
|
|||||||
if (o->type != AV_OPT_TYPE_BINARY)
|
if (o->type != AV_OPT_TYPE_BINARY)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
ptr = av_malloc(len);
|
ptr = len ? av_malloc(len) : NULL;
|
||||||
if (!ptr)
|
if (len && !ptr)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
dst = (uint8_t **)(((uint8_t *)target_obj) + o->offset);
|
dst = (uint8_t **)(((uint8_t *)target_obj) + o->offset);
|
||||||
@ -430,7 +430,8 @@ int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int
|
|||||||
av_free(*dst);
|
av_free(*dst);
|
||||||
*dst = ptr;
|
*dst = ptr;
|
||||||
*lendst = len;
|
*lendst = len;
|
||||||
memcpy(ptr, val, len);
|
if (len)
|
||||||
|
memcpy(ptr, val, len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user