mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-28 17:51:05 +00:00
rtpdec_jpeg: Merge two if statements
This makes the code more readable and robust. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
7ef4323405
commit
932d8300d3
@ -252,9 +252,13 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
|
||||
}
|
||||
|
||||
/* Parse the quantization table header. */
|
||||
if (q > 127 && off == 0) {
|
||||
uint8_t precision;
|
||||
if (off == 0) {
|
||||
/* Start of JPEG data packet. */
|
||||
uint8_t new_qtables[128];
|
||||
uint8_t hdr[1024];
|
||||
|
||||
if (q > 127) {
|
||||
uint8_t precision;
|
||||
if (len < 4) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Too short RTP/JPEG packet.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
@ -286,11 +290,6 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
|
||||
}
|
||||
}
|
||||
|
||||
if (off == 0) {
|
||||
/* Start of JPEG data packet. */
|
||||
uint8_t new_qtables[128];
|
||||
uint8_t hdr[1024];
|
||||
|
||||
/* Skip the current frame in case of the end packet
|
||||
* has been lost somewhere. */
|
||||
free_frame_if_needed(jpeg);
|
||||
|
Loading…
Reference in New Issue
Block a user