summaryrefslogtreecommitdiff
path: root/libavcodec/mjpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r--libavcodec/mjpeg.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index ed6016f939..a2362df9dc 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -2044,6 +2044,8 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
uint8_t x = *(src++);
*(dst++) = x;
+ if (avctx->codec_id != CODEC_ID_THP)
+ {
if (x == 0xff)
{
while(src<buf_end && x == 0xff)
@@ -2054,6 +2056,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
else if (x)
break;
}
+ }
}
init_get_bits(&s->gb, s->buffer, (dst - s->buffer)*8);
@@ -2583,6 +2586,19 @@ AVCodec mjpeg_decoder = {
NULL
};
+AVCodec thp_decoder = {
+ "thp",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_THP,
+ sizeof(MJpegDecodeContext),
+ mjpeg_decode_init,
+ NULL,
+ mjpeg_decode_end,
+ mjpeg_decode_frame,
+ CODEC_CAP_DR1,
+ NULL
+};
+
AVCodec mjpegb_decoder = {
"mjpegb",
CODEC_TYPE_VIDEO,