* This is a demuxer for Loki SDL Motion JPEG files
*/
+#include <inttypes.h>
+
#include "avformat.h"
#include "internal.h"
#include "riff.h"
avio_skip(pb, 8); // magic
version = avio_rb32(pb);
if (version)
- av_log_ask_for_sample(s, "unknown version %d\n", version);
+ avpriv_request_sample(s, "Unknown version %"PRIu32, version);
duration = avio_rb32(pb); // in msec
break;
case SMJPEG_SND:
if (ast) {
- av_log_ask_for_sample(s, "multiple audio streams not supported\n");
- return AVERROR_INVALIDDATA;
+ avpriv_request_sample(s, "Multiple audio streams");
+ return AVERROR_PATCHWELCOME;
}
hlength = avio_rb32(pb);
if (hlength < 8)
break;
case SMJPEG_VID:
if (vst) {
- av_log_ask_for_sample(s, "multiple video streams not supported\n");
+ avpriv_request_sample(s, "Multiple video streams");
return AVERROR_INVALIDDATA;
}
hlength = avio_rb32(pb);
case SMJPEG_HEND:
return 0;
default:
- av_log(s, AV_LOG_ERROR, "unknown header %x\n", htype);
+ av_log(s, AV_LOG_ERROR, "unknown header %"PRIx32"\n", htype);
return AVERROR_INVALIDDATA;
}
}
static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
SMJPEGContext *sc = s->priv_data;
- uint32_t dtype, ret, size, timestamp;
+ uint32_t dtype, size, timestamp;
int64_t pos;
+ int ret;
if (s->pb->eof_reached)
return AVERROR_EOF;
ret = AVERROR_EOF;
break;
default:
- av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", dtype);
+ av_log(s, AV_LOG_ERROR, "unknown chunk %"PRIx32"\n", dtype);
ret = AVERROR_INVALIDDATA;
break;
}