diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 2bf4af171e5045a58c7a49065667c0d8652cc7bf..0d312bbd81ac4fa77c7bf05ae7be4f06fc3960b5 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1194,11 +1194,10 @@ int MPV_encode_init(AVCodecContext *avctx)
         s->rtp_mode= 1;
         break;
     case CODEC_ID_LJPEG:
-    case CODEC_ID_JPEGLS:
     case CODEC_ID_MJPEG:
         s->out_format = FMT_MJPEG;
         s->intra_only = 1; /* force intra only for jpeg */
-        s->mjpeg_write_tables = avctx->codec->id != CODEC_ID_JPEGLS;
+        s->mjpeg_write_tables = 1;
         s->mjpeg_data_only_frames = 0; /* write all the needed headers */
         s->mjpeg_vsample[0] = 2;
         s->mjpeg_vsample[1] = 2>>chroma_v_shift;