avcodec/xwdenc: Don't modify input frame
These modifications were actually meant to be applied to the coded_frame, yet 08b31a72dbcf2935e871ef7c1ffa96ae200f78aa changed this and so this code has not been removed when coded_frame has been removed in 11bc79089378a5ec00547d0f85bc152afdf30dfa. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
f654aa8a09
commit
41e5555a00
@ -31,7 +31,7 @@
|
|||||||
#define WINDOW_NAME_SIZE 11
|
#define WINDOW_NAME_SIZE 11
|
||||||
|
|
||||||
static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||||
const AVFrame *pict, int *got_packet)
|
const AVFrame *p, int *got_packet)
|
||||||
{
|
{
|
||||||
enum AVPixelFormat pix_fmt = avctx->pix_fmt;
|
enum AVPixelFormat pix_fmt = avctx->pix_fmt;
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
|
||||||
@ -40,7 +40,6 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
uint32_t header_size;
|
uint32_t header_size;
|
||||||
int i, out_size, ret;
|
int i, out_size, ret;
|
||||||
uint8_t *ptr, *buf;
|
uint8_t *ptr, *buf;
|
||||||
AVFrame * const p = (AVFrame *)pict;
|
|
||||||
uint32_t pal[256];
|
uint32_t pal[256];
|
||||||
|
|
||||||
pixdepth = av_get_bits_per_pixel(desc);
|
pixdepth = av_get_bits_per_pixel(desc);
|
||||||
@ -151,9 +150,6 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
return ret;
|
return ret;
|
||||||
buf = pkt->data;
|
buf = pkt->data;
|
||||||
|
|
||||||
p->key_frame = 1;
|
|
||||||
p->pict_type = AV_PICTURE_TYPE_I;
|
|
||||||
|
|
||||||
bytestream_put_be32(&buf, header_size);
|
bytestream_put_be32(&buf, header_size);
|
||||||
bytestream_put_be32(&buf, XWD_VERSION); // file version
|
bytestream_put_be32(&buf, XWD_VERSION); // file version
|
||||||
bytestream_put_be32(&buf, XWD_Z_PIXMAP); // pixmap format
|
bytestream_put_be32(&buf, XWD_Z_PIXMAP); // pixmap format
|
||||||
|
Loading…
x
Reference in New Issue
Block a user