mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
ffplay: remove VideoPicture pix_fmt and use frame pixel format instead
VideoPicture pixel format is set at allocation time, therefore it is not reflecting the proper value. Fixes files with changing pixel format in the avfilter disabled case. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
15751e3fdd
commit
f1a75aa033
6
ffplay.c
6
ffplay.c
@ -106,7 +106,6 @@ typedef struct VideoPicture {
|
|||||||
AVRational sample_aspect_ratio;
|
AVRational sample_aspect_ratio;
|
||||||
int allocated;
|
int allocated;
|
||||||
int reallocate;
|
int reallocate;
|
||||||
enum PixelFormat pix_fmt;
|
|
||||||
|
|
||||||
#if CONFIG_AVFILTER
|
#if CONFIG_AVFILTER
|
||||||
AVFilterBufferRef *picref;
|
AVFilterBufferRef *picref;
|
||||||
@ -1320,7 +1319,6 @@ static void alloc_picture(AllocEventProps *event_props)
|
|||||||
|
|
||||||
vp->width = frame->width;
|
vp->width = frame->width;
|
||||||
vp->height = frame->height;
|
vp->height = frame->height;
|
||||||
vp->pix_fmt = frame->format;
|
|
||||||
|
|
||||||
video_open(event_props->is, 0);
|
video_open(event_props->is, 0);
|
||||||
|
|
||||||
@ -1441,12 +1439,12 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
|
|||||||
#if CONFIG_AVFILTER
|
#if CONFIG_AVFILTER
|
||||||
// FIXME use direct rendering
|
// FIXME use direct rendering
|
||||||
av_picture_copy(&pict, (AVPicture *)src_frame,
|
av_picture_copy(&pict, (AVPicture *)src_frame,
|
||||||
vp->pix_fmt, vp->width, vp->height);
|
src_frame->format, vp->width, vp->height);
|
||||||
vp->sample_aspect_ratio = vp->picref->video->sample_aspect_ratio;
|
vp->sample_aspect_ratio = vp->picref->video->sample_aspect_ratio;
|
||||||
#else
|
#else
|
||||||
sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
|
sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
|
||||||
is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
|
is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
|
||||||
vp->width, vp->height, vp->pix_fmt, vp->width, vp->height,
|
vp->width, vp->height, src_frame->format, vp->width, vp->height,
|
||||||
PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL);
|
PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL);
|
||||||
if (is->img_convert_ctx == NULL) {
|
if (is->img_convert_ctx == NULL) {
|
||||||
fprintf(stderr, "Cannot initialize the conversion context\n");
|
fprintf(stderr, "Cannot initialize the conversion context\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user