]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/sunrast.c
indent
[ffmpeg] / libavcodec / sunrast.c
index 2fe4331028c3e67e5a7bfc1b75f3c18327d7f4c1..c8f021f85007aa31fd2232c8d28bcc60a7cefde1 100644 (file)
@@ -32,7 +32,7 @@ typedef struct SUNRASTContext {
     AVFrame picture;
 } SUNRASTContext;
 
-static int sunrast_init(AVCodecContext *avctx) {
+static av_cold int sunrast_init(AVCodecContext *avctx) {
     SUNRASTContext *s = avctx->priv_data;
 
     avcodec_get_frame_defaults(&s->picture);
@@ -42,12 +42,13 @@ static int sunrast_init(AVCodecContext *avctx) {
 }
 
 static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
-                                int *data_size, uint8_t *buf, int buf_size) {
+                                int *data_size, const uint8_t *buf, int buf_size) {
     SUNRASTContext * const s = avctx->priv_data;
     AVFrame *picture = data;
     AVFrame * const p = &s->picture;
     unsigned int w, h, depth, type, maptype, maplength, stride, x, y, len, alen;
-    uint8_t *ptr, *bufstart = buf;
+    uint8_t *ptr;
+    const uint8_t *bufstart = buf;
 
     if (AV_RB32(buf) != 0x59a66a95) {
         av_log(avctx, AV_LOG_ERROR, "this is not sunras encoded data\n");
@@ -120,8 +121,6 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
             return -1;
         }
 
-        av_log(avctx, AV_LOG_DEBUG, "maplength %u\n", len);
-
         ptr = p->data[1];
         for (x=0; x<len; x++, ptr+=4)
             *(uint32_t *)ptr = (buf[x]<<16) + (buf[len+x]<<8) + buf[len+len+x];
@@ -173,7 +172,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
     return buf - bufstart;
 }
 
-static int sunrast_end(AVCodecContext *avctx) {
+static av_cold int sunrast_end(AVCodecContext *avctx) {
     SUNRASTContext *s = avctx->priv_data;
 
     if(s->picture.data[0])
@@ -192,5 +191,6 @@ AVCodec sunrast_decoder = {
     sunrast_end,
     sunrast_decode_frame,
     0,
-    NULL
+    NULL,
+    .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
 };