diff mbox

[FFmpeg-devel] lavf/rtpdec_jpeg: Treat stream type 64 like 0.

Message ID CAB0OVGqW8z_w3869J7dGrPkkR8ssfV3L9N1wLV70BXE+Vc176Q@mail.gmail.com
State Rejected
Headers show

Commit Message

Carl Eugen Hoyos Jan. 5, 2018, 4:43 a.m. UTC
Hi!

Attached patch intends to fix ticket #5975, rfc 2435 says stream type
64 should be treated like 0.

Please review, Carl Eugen

Comments

Michael Niedermayer Jan. 6, 2018, 1:45 a.m. UTC | #1
On Fri, Jan 05, 2018 at 05:43:01AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch intends to fix ticket #5975, rfc 2435 says stream type
> 64 should be treated like 0.
> 
> Please review, Carl Eugen

>  rtpdec_jpeg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 6c39ed6cee670ad983250a1dd2566d9aa58b7abf  0001-lavf-rtpdec_jpeg-Treat-jpeg-type-64-like-0.patch
> From 690f2fccf766f3cbb23a1ef45e235e25c355b197 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Fri, 5 Jan 2018 05:40:30 +0100
> Subject: [PATCH] lavf/rtpdec_jpeg: Treat jpeg type 64 like 0.
> 
> Fixes ticket #5975.
> ---
>  libavformat/rtpdec_jpeg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
> index 465d9bc..3a33e3a 100644
> --- a/libavformat/rtpdec_jpeg.c
> +++ b/libavformat/rtpdec_jpeg.c
> @@ -162,7 +162,7 @@ static int jpeg_create_header(uint8_t *buf, int size, uint32_t type, uint32_t w,
>      bytestream2_put_be16(&pbc, w);
>      bytestream2_put_byte(&pbc, 3); /* number of components */
>      bytestream2_put_byte(&pbc, 1); /* component number */
> -    bytestream2_put_byte(&pbc, (2 << 4) | (type ? 2 : 1)); /* hsample/vsample */
> +    bytestream2_put_byte(&pbc, (2 << 4) | (type & ~64 ? 2 : 1)); /* hsample/vsample */

isnt 64 masked out already ?
"        type &= ~0x40;"

am i missing something ?

[...]
Carl Eugen Hoyos Jan. 6, 2018, 12:53 p.m. UTC | #2
2018-01-06 2:45 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
> On Fri, Jan 05, 2018 at 05:43:01AM +0100, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch intends to fix ticket #5975, rfc 2435 says stream type
>> 64 should be treated like 0.
>>
>> Please review, Carl Eugen
>
>>  rtpdec_jpeg.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 6c39ed6cee670ad983250a1dd2566d9aa58b7abf  0001-lavf-rtpdec_jpeg-Treat-jpeg-type-64-like-0.patch
>> From 690f2fccf766f3cbb23a1ef45e235e25c355b197 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Fri, 5 Jan 2018 05:40:30 +0100
>> Subject: [PATCH] lavf/rtpdec_jpeg: Treat jpeg type 64 like 0.
>>
>> Fixes ticket #5975.
>> ---
>>  libavformat/rtpdec_jpeg.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
>> index 465d9bc..3a33e3a 100644
>> --- a/libavformat/rtpdec_jpeg.c
>> +++ b/libavformat/rtpdec_jpeg.c
>> @@ -162,7 +162,7 @@ static int jpeg_create_header(uint8_t *buf, int size, uint32_t type, uint32_t w,
>>      bytestream2_put_be16(&pbc, w);
>>      bytestream2_put_byte(&pbc, 3); /* number of components */
>>      bytestream2_put_byte(&pbc, 1); /* component number */
>> -    bytestream2_put_byte(&pbc, (2 << 4) | (type ? 2 : 1)); /* hsample/vsample */
>> +    bytestream2_put_byte(&pbc, (2 << 4) | (type & ~64 ? 2 : 1)); /* hsample/vsample */
>
> isnt 64 masked out already ?
> "        type &= ~0x40;"
>
> am i missing something ?

No, the reporter of ticket #5975 and I missed my commit...

Thank you, Carl Eugen
diff mbox

Patch

From 690f2fccf766f3cbb23a1ef45e235e25c355b197 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Fri, 5 Jan 2018 05:40:30 +0100
Subject: [PATCH] lavf/rtpdec_jpeg: Treat jpeg type 64 like 0.

Fixes ticket #5975.
---
 libavformat/rtpdec_jpeg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
index 465d9bc..3a33e3a 100644
--- a/libavformat/rtpdec_jpeg.c
+++ b/libavformat/rtpdec_jpeg.c
@@ -162,7 +162,7 @@  static int jpeg_create_header(uint8_t *buf, int size, uint32_t type, uint32_t w,
     bytestream2_put_be16(&pbc, w);
     bytestream2_put_byte(&pbc, 3); /* number of components */
     bytestream2_put_byte(&pbc, 1); /* component number */
-    bytestream2_put_byte(&pbc, (2 << 4) | (type ? 2 : 1)); /* hsample/vsample */
+    bytestream2_put_byte(&pbc, (2 << 4) | (type & ~64 ? 2 : 1)); /* hsample/vsample */
     bytestream2_put_byte(&pbc, 0); /* matrix number */
     bytestream2_put_byte(&pbc, 2); /* component number */
     bytestream2_put_byte(&pbc, 1 << 4 | 1); /* hsample/vsample */
-- 
1.7.10.4