Advertisement
Guest User

Untitled

a guest
Oct 21st, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. $ git diff
  2. diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
  3. index 86ec58713c..f9131ea45a 100644
  4. --- a/libavcodec/mjpegdec.c
  5. +++ b/libavcodec/mjpegdec.c
  6. @@ -313,6 +313,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
  7. len = get_bits(&s->gb, 16);
  8. bits = get_bits(&s->gb, 8);
  9.  
  10. +// FIXME hack to force bayer, don't yet know how / where I'm
  11. +// supposed to set this before getting here.
  12. + s->bayer = 1;
  13. +
  14. if (bits > 16 || bits < 1) {
  15. av_log(s->avctx, AV_LOG_ERROR, "bits %d is invalid\n", bits);
  16. return AVERROR_INVALIDDATA;
  17. diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
  18. index 1a6d38f37c..2eb21a3aab 100644
  19. --- a/libavformat/mlvdec.c
  20. +++ b/libavformat/mlvdec.c
  21. @@ -44,8 +44,9 @@
  22.  
  23. #define MLV_AUDIO_CLASS_WAV 1
  24.  
  25. -#define MLV_CLASS_FLAG_DELTA 0x40
  26. #define MLV_CLASS_FLAG_LZMA 0x80
  27. +#define MLV_CLASS_FLAG_DELTA 0x40
  28. +#define MLV_CLASS_FLAG_LJ92 0x20
  29.  
  30. typedef struct {
  31. AVIOContext *pb[101];
  32. @@ -298,9 +299,12 @@ static int read_header(AVFormatContext *avctx)
  33. if ((mlv->class[0] & (MLV_CLASS_FLAG_DELTA|MLV_CLASS_FLAG_LZMA)))
  34. avpriv_request_sample(avctx, "compression");
  35. vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
  36. - switch (mlv->class[0] & ~(MLV_CLASS_FLAG_DELTA|MLV_CLASS_FLAG_LZMA)) {
  37. + switch (mlv->class[0] & ~(MLV_CLASS_FLAG_DELTA|MLV_CLASS_FLAG_LZMA|MLV_CLASS_FLAG_LJ92)) {
  38. case MLV_VIDEO_CLASS_RAW:
  39. - vst->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
  40. + if (mlv->class[0] & MLV_CLASS_FLAG_LJ92)
  41. + vst->codecpar->codec_id = AV_CODEC_ID_MJPEG;
  42. + else
  43. + vst->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
  44. break;
  45. case MLV_VIDEO_CLASS_YUV:
  46. vst->codecpar->format = AV_PIX_FMT_YUV420P;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement