summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_jpeg.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-09-11 14:39:58 +0300
committerMartin Storsjö <martin@martin.st>2012-09-12 12:10:32 +0300
commit1de9317bd08d71b6b988a8a64de18f4c2f98e031 (patch)
tree6653752c20fe9c68901cabb76bd7df7068ac032d /libavformat/rtpdec_jpeg.c
parenta218deb856e7352b16e5aa3013a2b3fcdd0e3d2f (diff)
rtpdec_jpeg: Fold the default qtables case into an existing if statement
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec_jpeg.c')
-rw-r--r--libavformat/rtpdec_jpeg.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
index 9dd5f68764..3f47e71bd3 100644
--- a/libavformat/rtpdec_jpeg.c
+++ b/libavformat/rtpdec_jpeg.c
@@ -303,6 +303,10 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
qtables = &jpeg->qtables[q - 128][0];
qtable_len = jpeg->qtables_len[q - 128];
}
+ } else { /* q <= 127 */
+ create_default_qtables(new_qtables, q);
+ qtables = new_qtables;
+ qtable_len = sizeof(new_qtables);
}
/* Skip the current frame in case of the end packet
@@ -313,12 +317,6 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
return ret;
jpeg->timestamp = *timestamp;
- if (!qtables) {
- create_default_qtables(new_qtables, q);
- qtables = new_qtables;
- qtable_len = sizeof(new_qtables);
- }
-
/* Generate a frame and scan headers that can be prepended to the
* RTP/JPEG data payload to produce a JPEG compressed image in
* interchange format. */