diff mbox series

[FFmpeg-devel,2/3] avcodec/codec2utils: move codec2_version_from_extradata to lavf

Message ID 20201027141859.1346-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avcodec/codec2utils: remove avpriv prefix from inline functions | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

James Almer Oct. 27, 2020, 2:18 p.m. UTC
It's only used by the codec2 demuxers

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/codec2utils.h | 5 -----
 libavformat/codec2.c     | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Andreas Rheinhardt Oct. 27, 2020, 3:47 p.m. UTC | #1
James Almer:
> It's only used by the codec2 demuxers
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/codec2utils.h | 5 -----
>  libavformat/codec2.c     | 5 +++++
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/codec2utils.h b/libavcodec/codec2utils.h
> index e9b1f84d84..2ee7a592a1 100644
> --- a/libavcodec/codec2utils.h
> +++ b/libavcodec/codec2utils.h
> @@ -70,11 +70,6 @@ static inline void codec2_make_extradata(uint8_t *ptr, int mode) {
>      ptr[3] = 0;     //flags
>  }
>  
> -//Returns version as a 16-bit value. 0.8 -> 0x0008
> -static inline uint16_t codec2_version_from_extradata(uint8_t *ptr) {
> -    return (ptr[0] << 8) + ptr[1];
> -}
> -
>  static inline uint8_t codec2_mode_from_extradata(uint8_t *ptr) {
>      return ptr[2];
>  }
> diff --git a/libavformat/codec2.c b/libavformat/codec2.c
> index 1f7f16a106..edd450716f 100644
> --- a/libavformat/codec2.c
> +++ b/libavformat/codec2.c
> @@ -86,6 +86,11 @@ static int codec2_read_header_common(AVFormatContext *s, AVStream *st)
>      return 0;
>  }
>  
> +//Returns version as a 16-bit value. 0.8 -> 0x0008
> +static uint16_t codec2_version_from_extradata(uint8_t *ptr) {
> +    return (ptr[0] << 8) + ptr[1];
> +}
> +
>  static int codec2_read_header(AVFormatContext *s)
>  {
>      AVStream *st = avformat_new_stream(s, NULL);
> 
Why not just remove this and directly use AV_RB16()?

- Andreas
James Almer Oct. 28, 2020, 12:10 a.m. UTC | #2
On 10/27/2020 12:47 PM, Andreas Rheinhardt wrote:
> James Almer:
>> It's only used by the codec2 demuxers
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavcodec/codec2utils.h | 5 -----
>>  libavformat/codec2.c     | 5 +++++
>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavcodec/codec2utils.h b/libavcodec/codec2utils.h
>> index e9b1f84d84..2ee7a592a1 100644
>> --- a/libavcodec/codec2utils.h
>> +++ b/libavcodec/codec2utils.h
>> @@ -70,11 +70,6 @@ static inline void codec2_make_extradata(uint8_t *ptr, int mode) {
>>      ptr[3] = 0;     //flags
>>  }
>>  
>> -//Returns version as a 16-bit value. 0.8 -> 0x0008
>> -static inline uint16_t codec2_version_from_extradata(uint8_t *ptr) {
>> -    return (ptr[0] << 8) + ptr[1];
>> -}
>> -
>>  static inline uint8_t codec2_mode_from_extradata(uint8_t *ptr) {
>>      return ptr[2];
>>  }
>> diff --git a/libavformat/codec2.c b/libavformat/codec2.c
>> index 1f7f16a106..edd450716f 100644
>> --- a/libavformat/codec2.c
>> +++ b/libavformat/codec2.c
>> @@ -86,6 +86,11 @@ static int codec2_read_header_common(AVFormatContext *s, AVStream *st)
>>      return 0;
>>  }
>>  
>> +//Returns version as a 16-bit value. 0.8 -> 0x0008
>> +static uint16_t codec2_version_from_extradata(uint8_t *ptr) {
>> +    return (ptr[0] << 8) + ptr[1];
>> +}
>> +
>>  static int codec2_read_header(AVFormatContext *s)
>>  {
>>      AVStream *st = avformat_new_stream(s, NULL);
>>
> Why not just remove this and directly use AV_RB16()?

Ok, will do that.

> 
> - Andreas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavcodec/codec2utils.h b/libavcodec/codec2utils.h
index e9b1f84d84..2ee7a592a1 100644
--- a/libavcodec/codec2utils.h
+++ b/libavcodec/codec2utils.h
@@ -70,11 +70,6 @@  static inline void codec2_make_extradata(uint8_t *ptr, int mode) {
     ptr[3] = 0;     //flags
 }
 
-//Returns version as a 16-bit value. 0.8 -> 0x0008
-static inline uint16_t codec2_version_from_extradata(uint8_t *ptr) {
-    return (ptr[0] << 8) + ptr[1];
-}
-
 static inline uint8_t codec2_mode_from_extradata(uint8_t *ptr) {
     return ptr[2];
 }
diff --git a/libavformat/codec2.c b/libavformat/codec2.c
index 1f7f16a106..edd450716f 100644
--- a/libavformat/codec2.c
+++ b/libavformat/codec2.c
@@ -86,6 +86,11 @@  static int codec2_read_header_common(AVFormatContext *s, AVStream *st)
     return 0;
 }
 
+//Returns version as a 16-bit value. 0.8 -> 0x0008
+static uint16_t codec2_version_from_extradata(uint8_t *ptr) {
+    return (ptr[0] << 8) + ptr[1];
+}
+
 static int codec2_read_header(AVFormatContext *s)
 {
     AVStream *st = avformat_new_stream(s, NULL);