History

truemotion2rt: Use ff_set_dimensions

Vittorio Giovara committed 10 years ago

Commit 40dd5161 parent a8164321 file · +8 −3Browse files

Unified · Split

libavcodec/truemotion2rt.c+8−3
@@ -63,7 +63,8 @@ static int truemotion2rt_decode_header(AVCodecContext *avctx, AVPacket *avpkt) · 62 unmodified lines
63 uint8_t header_buffer[128] = { 0 }; /* logical maximum header size */63 uint8_t header_buffer[128] = { 0 }; /* logical maximum header size */
64 const uint8_t *buf = avpkt->data;64 const uint8_t *buf = avpkt->data;
65 int size = avpkt->size;65 int size = avpkt->size;
66 int i;66 int width, height;
67 int ret, i;
67 68
68 if (size < 1) {69 if (size < 1) {
69 av_log(avctx, AV_LOG_ERROR, "input packet too small (%d)\n", size);70 av_log(avctx, AV_LOG_ERROR, "input packet too small (%d)\n", size);
@@ -90,8 +91,12 @@ static int truemotion2rt_decode_header(AVCodecContext *avctx, AVPacket *avpkt) · 20 unmodified lines
90 if (s->delta_size < 2 || s->delta_size > 4)91 if (s->delta_size < 2 || s->delta_size > 4)
91 return AVERROR_INVALIDDATA;92 return AVERROR_INVALIDDATA;
92 93
93 avctx->height = AV_RL16(header_buffer + 5);94 height = AV_RL16(header_buffer + 5);
94 avctx->width = AV_RL16(header_buffer + 7);95 width = AV_RL16(header_buffer + 7);
96
97 ret = ff_set_dimensions(avctx, width, height);
98 if (ret < 0)
99 return ret;
95 100
96 av_log(avctx, AV_LOG_DEBUG, "Header size: %d\n", header_size);101 av_log(avctx, AV_LOG_DEBUG, "Header size: %d\n", header_size);
97 return header_size;102 return header_size;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t