0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

linux-v4l2: Fix warnings in mjpeg

Previously the switch did not catch all cases issuing a quite large
warning. Also there was a const-ness warning for codecs on ffmpeg 5.0
that this addresses.
This commit is contained in:
Kurt Kartaltepe 2022-02-21 14:41:07 -08:00 committed by Matt Gajownik
parent bad7edd051
commit eff0148dd7
2 changed files with 3 additions and 2 deletions

View File

@ -75,7 +75,6 @@ void v4l2_destroy_mjpeg(struct v4l2_mjpeg_decoder *decoder)
int v4l2_decode_mjpeg(struct obs_source_frame *out, uint8_t *data,
size_t length, struct v4l2_mjpeg_decoder *decoder)
{
decoder->packet->data = data;
decoder->packet->size = length;
if (avcodec_send_packet(decoder->context, decoder->packet) < 0) {
@ -106,6 +105,8 @@ int v4l2_decode_mjpeg(struct obs_source_frame *out, uint8_t *data,
case AV_PIX_FMT_YUV444P:
out->format = VIDEO_FORMAT_I444;
break;
default:
break;
}
return 0;

View File

@ -29,7 +29,7 @@ extern "C" {
* Data structure for mjpeg decoding
*/
struct v4l2_mjpeg_decoder {
AVCodec *codec;
const AVCodec *codec;
AVCodecContext *context;
AVPacket *packet;
AVFrame *frame;