[FFmpeg-cvslog] Revert "avformat/mpegtsenc: Change the service_type field to enum"

Michael Niedermayer git at videolan.org
Mon Feb 2 22:40:35 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Feb  2 22:30:56 2015 +0100| [c348a42dcc93c21cdc114769a29eba955bdb74f9] | committer: Michael Niedermayer

Revert "avformat/mpegtsenc: Change the service_type field to enum"

This isnt safe due to AVOption accessing this field as int
i just realized a moment after pushing

This reverts commit 0935453e84a17035f0c3544913e7ab7775839176.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c348a42dcc93c21cdc114769a29eba955bdb74f9
---

 libavformat/mpegtsenc.c |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 2a5624d..46ff522 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -57,17 +57,6 @@ typedef struct MpegTSService {
     int pcr_packet_period;
 } MpegTSService;
 
-/// service_type values as defined in ETSI 300 468
-enum ServiceType{
-    MPEGTS_SERVICE_TYPE_DIGITAL_TV                   = 0x01,
-    MPEGTS_SERVICE_TYPE_DIGITAL_RADIO                = 0x02,
-    MPEGTS_SERVICE_TYPE_TELETEXT                     = 0x03,
-    MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_RADIO = 0x0A,
-    MPEGTS_SERVICE_TYPE_MPEG2_DIGITAL_HDTV           = 0x11,
-    MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_SDTV  = 0x16,
-    MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_HDTV  = 0x19
-};
-
 typedef struct MpegTSWrite {
     const AVClass *av_class;
     MpegTSSection pat; /* MPEG2 pat table */
@@ -87,7 +76,17 @@ typedef struct MpegTSWrite {
     int transport_stream_id;
     int original_network_id;
     int service_id;
-    enum ServiceType service_type;
+    int service_type;
+// service_type values as defined in ETSI 300 468
+   enum {
+     MPEGTS_SERVICE_TYPE_DIGITAL_TV                   = 0x01,
+     MPEGTS_SERVICE_TYPE_DIGITAL_RADIO                = 0x02,
+     MPEGTS_SERVICE_TYPE_TELETEXT                     = 0x03,
+     MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_RADIO = 0x0A,
+     MPEGTS_SERVICE_TYPE_MPEG2_DIGITAL_HDTV           = 0x11,
+     MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_SDTV  = 0x16,
+     MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_HDTV  = 0x19
+   };
 
     int pmt_start_pid;
     int start_pid;



More information about the ffmpeg-cvslog mailing list