diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-09-28 20:47:07 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-09-28 20:47:07 +0000 |
commit | c6b1edc911920b2254c8f3c29eafa8b4eb42d794 (patch) | |
tree | d0653b22169119468ca5ae83568cbdc26b6eedcf /ffplay.c | |
parent | d663a1fdc0fd405aafabc9bca6d19d02ca640df9 (diff) | |
download | ffmpeg-c6b1edc911920b2254c8f3c29eafa8b4eb42d794.tar.gz |
init AVFrame with defaults
Originally committed as revision 2312 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -838,7 +838,7 @@ static int video_thread(void *arg) AVPacket pkt1, *pkt = &pkt1; unsigned char *ptr; int len, len1, got_picture; - AVFrame frame; + AVFrame *frame= avcodec_alloc_frame(); int64_t ipts; double pts; @@ -853,15 +853,15 @@ static int video_thread(void *arg) ipts = pkt->pts; ptr = pkt->data; if (is->video_st->codec.codec_id == CODEC_ID_RAWVIDEO) { - avpicture_fill((AVPicture *)&frame, ptr, + avpicture_fill((AVPicture *)frame, ptr, is->video_st->codec.pix_fmt, is->video_st->codec.width, is->video_st->codec.height); pts = 0; if (ipts != AV_NOPTS_VALUE) pts = (double)ipts * is->ic->pts_num / is->ic->pts_den; - frame.pict_type = FF_I_TYPE; - if (output_picture2(is, &frame, pts) < 0) + frame->pict_type = FF_I_TYPE; + if (output_picture2(is, frame, pts) < 0) goto the_end; } else { len = pkt->size; @@ -872,14 +872,14 @@ static int video_thread(void *arg) ipts = AV_NOPTS_VALUE; } len1 = avcodec_decode_video(&is->video_st->codec, - &frame, &got_picture, ptr, len); + frame, &got_picture, ptr, len); if (len1 < 0) break; if (got_picture) { pts = 0; if (is->ipts != AV_NOPTS_VALUE) pts = (double)is->ipts * is->ic->pts_num / is->ic->pts_den; - if (output_picture2(is, &frame, pts) < 0) + if (output_picture2(is, frame, pts) < 0) goto the_end; is->picture_start = 1; } @@ -890,6 +890,7 @@ static int video_thread(void *arg) av_free_packet(pkt); } the_end: + av_free(frame); return 0; } |