diff mbox series

[FFmpeg-devel] libformat: Remove duplicate STREAM_TYPE constants from mpeg.h

Message ID 20200603101610.25977-1-bradh@frogmouth.net
State New
Headers show
Series [FFmpeg-devel] libformat: Remove duplicate STREAM_TYPE constants from mpeg.h | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Brad Hards June 3, 2020, 10:16 a.m. UTC
These definitions (and more STREAM_TYPEs) are already provided in mpegts.h

Signed-off-by: Brad Hards <bradh@frogmouth.net>
---
 libavformat/mpeg.c |  1 +
 libavformat/mpeg.h | 14 --------------
 2 files changed, 1 insertion(+), 14 deletions(-)

Comments

Marton Balint June 3, 2020, 8:44 p.m. UTC | #1
On Wed, 3 Jun 2020, Brad Hards wrote:

> These definitions (and more STREAM_TYPEs) are already provided in mpegts.h
>
> Signed-off-by: Brad Hards <bradh@frogmouth.net>
> ---
> libavformat/mpeg.c |  1 +
> libavformat/mpeg.h | 14 --------------
> 2 files changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
> index 265b2bd1ad..d9807d6d43 100644
> --- a/libavformat/mpeg.c
> +++ b/libavformat/mpeg.c
> @@ -23,6 +23,7 @@
> #include "avio_internal.h"
> #include "internal.h"
> #include "mpeg.h"
> +#include "mpegts.h"

Including mpegts.h into mpeg.c does not seem like a good idea.

Also I guess MPEG-PS and MPEG-TS may support different stream_types, 
right? In that case it may make more sense to keep the two lists separate.

Regards,
Marton

> 
> /*********************************************/
> /* demux code */
> diff --git a/libavformat/mpeg.h b/libavformat/mpeg.h
> index b635295776..b1d80df31a 100644
> --- a/libavformat/mpeg.h
> +++ b/libavformat/mpeg.h
> @@ -46,20 +46,6 @@
> #define LPCM_ID  0xa0
> #define SUB_ID   0x20
> 
> -#define STREAM_TYPE_VIDEO_MPEG1     0x01
> -#define STREAM_TYPE_VIDEO_MPEG2     0x02
> -#define STREAM_TYPE_AUDIO_MPEG1     0x03
> -#define STREAM_TYPE_AUDIO_MPEG2     0x04
> -#define STREAM_TYPE_PRIVATE_SECTION 0x05
> -#define STREAM_TYPE_PRIVATE_DATA    0x06
> -#define STREAM_TYPE_AUDIO_AAC       0x0f
> -#define STREAM_TYPE_VIDEO_MPEG4     0x10
> -#define STREAM_TYPE_VIDEO_H264      0x1b
> -#define STREAM_TYPE_VIDEO_HEVC      0x24
> -#define STREAM_TYPE_VIDEO_CAVS      0x42
> -
> -#define STREAM_TYPE_AUDIO_AC3       0x81
> -
> static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
> 
> /**
> -- 
> 2.17.1
>
> _______________________________________________
> 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".
Brad Hards June 3, 2020, 10:57 p.m. UTC | #2
Would an "iso13138_1_defs.h" be more appropriate as a home for these definitions?

Otherwise I can just drop the patch - its only a cosmetic cleanup.

Brad
diff mbox series

Patch

diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 265b2bd1ad..d9807d6d43 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -23,6 +23,7 @@ 
 #include "avio_internal.h"
 #include "internal.h"
 #include "mpeg.h"
+#include "mpegts.h"
 
 /*********************************************/
 /* demux code */
diff --git a/libavformat/mpeg.h b/libavformat/mpeg.h
index b635295776..b1d80df31a 100644
--- a/libavformat/mpeg.h
+++ b/libavformat/mpeg.h
@@ -46,20 +46,6 @@ 
 #define LPCM_ID  0xa0
 #define SUB_ID   0x20
 
-#define STREAM_TYPE_VIDEO_MPEG1     0x01
-#define STREAM_TYPE_VIDEO_MPEG2     0x02
-#define STREAM_TYPE_AUDIO_MPEG1     0x03
-#define STREAM_TYPE_AUDIO_MPEG2     0x04
-#define STREAM_TYPE_PRIVATE_SECTION 0x05
-#define STREAM_TYPE_PRIVATE_DATA    0x06
-#define STREAM_TYPE_AUDIO_AAC       0x0f
-#define STREAM_TYPE_VIDEO_MPEG4     0x10
-#define STREAM_TYPE_VIDEO_H264      0x1b
-#define STREAM_TYPE_VIDEO_HEVC      0x24
-#define STREAM_TYPE_VIDEO_CAVS      0x42
-
-#define STREAM_TYPE_AUDIO_AC3       0x81
-
 static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
 
 /**