]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qtrleenc.c
mips: add assembler flags for mips32r2 ISA and mhard-float
[ffmpeg] / libavcodec / qtrleenc.c
index 6cbff30346839ebfb8e9542bdc6ed0b5b21f5877..2fb9c1c928581d78bfb69f72e1cc1f4e646a6c29 100644 (file)
@@ -64,9 +64,10 @@ typedef struct QtrleEncContext {
 static av_cold int qtrle_encode_init(AVCodecContext *avctx)
 {
     QtrleEncContext *s = avctx->priv_data;
+    int ret;
 
     if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) {
-        return -1;
+        return AVERROR(EINVAL);
     }
     s->avctx=avctx;
     s->logical_width=avctx->width;
@@ -96,11 +97,11 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx)
     s->length_table  = av_mallocz((s->logical_width + 1)*sizeof(int));
     if (!s->skip_table || !s->length_table || !s->rlecode_table) {
         av_log(avctx, AV_LOG_ERROR, "Error allocating memory.\n");
-        return -1;
+        return AVERROR(ENOMEM);
     }
-    if (avpicture_alloc(&s->previous_frame, avctx->pix_fmt, avctx->width, avctx->height) < 0) {
+    if ((ret = avpicture_alloc(&s->previous_frame, avctx->pix_fmt, avctx->width, avctx->height)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "Error allocating picture\n");
-        return -1;
+        return ret;
     }
 
     s->max_buf_size = s->logical_width*s->avctx->height*s->pixel_size*2 /* image base material */
@@ -349,7 +350,7 @@ static av_cold int qtrle_encode_end(AVCodecContext *avctx)
 AVCodec ff_qtrle_encoder = {
     .name           = "qtrle",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_QTRLE,
+    .id             = AV_CODEC_ID_QTRLE,
     .priv_data_size = sizeof(QtrleEncContext),
     .init           = qtrle_encode_init,
     .encode2        = qtrle_encode_frame,