@@ -716,10 +716,10 @@ static const StreamType HDMV_types[] = {
716716
717717/* ATSC ? */
718718static const StreamType MISC_types [] = {
719- { 0x81 , AVMEDIA_TYPE_AUDIO , CODEC_ID_AC3 },
720- { 0x8a , AVMEDIA_TYPE_AUDIO , CODEC_ID_DTS },
721- { 0x100 , CODEC_TYPE_SUBTITLE , CODEC_ID_DVB_SUBTITLE },
722- { 0x101 , CODEC_TYPE_DATA , CODEC_ID_DVB_VBI },
719+ { 0x81 , AVMEDIA_TYPE_AUDIO , CODEC_ID_AC3 },
720+ { 0x8a , AVMEDIA_TYPE_AUDIO , CODEC_ID_DTS },
721+ { 0x100 , AVMEDIA_TYPE_SUBTITLE , CODEC_ID_DVB_SUBTITLE },
722+ { 0x101 , AVMEDIA_TYPE_DATA , CODEC_ID_DVB_VBI },
723723 { 0 },
724724};
725725
@@ -749,8 +749,8 @@ static const StreamType DESC_types[] = {
749749
750750/* component tags */
751751static const StreamType COMPONENT_TAG_types [] = {
752- { 0x0a , CODEC_TYPE_AUDIO , CODEC_ID_MP3 },
753- { 0x52 , CODEC_TYPE_VIDEO , CODEC_ID_MPEG2VIDEO },
752+ { 0x0a , AVMEDIA_TYPE_AUDIO , CODEC_ID_MP3 },
753+ { 0x52 , AVMEDIA_TYPE_VIDEO , CODEC_ID_MPEG2VIDEO },
754754};
755755
756756static void mpegts_find_stream_type (AVStream * st ,
@@ -1533,14 +1533,15 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15331533 language [1 ] = get8 (pp , desc_end );
15341534 language [2 ] = get8 (pp , desc_end );
15351535 language [3 ] = 0 ;
1536- av_dict_set (& st -> metadata , "language" , language , 0 );
15371536 break ;
15381537 case 0x59 : /* subtitling descriptor */
15391538 language [0 ] = get8 (pp , desc_end );
15401539 language [1 ] = get8 (pp , desc_end );
15411540 language [2 ] = get8 (pp , desc_end );
15421541 language [3 ] = 0 ;
1542+ get8 (pp , desc_end );
15431543
1544+ #if 0
15441545 /* hearing impaired subtitles detection */
15451546 switch (get8 (pp , desc_end )) {
15461547 case 0x20 : /* DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality */
@@ -1552,6 +1553,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15521553 st -> disposition |= AV_DISPOSITION_HEARING_IMPAIRED ;
15531554 break ;
15541555 }
1556+ #endif
15551557
15561558 dvbci -> comp_page = get16 (pp , desc_end );
15571559 dvbci -> anc_page = get16 (pp , desc_end );
@@ -1570,7 +1572,6 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15701572 }
15711573#endif
15721574 * pp += 4 ;
1573- av_dict_set (& st -> metadata , "language" , language , 0 );
15741575 break ;
15751576 case 0x0a : /* ISO 639 language descriptor */
15761577 for (i = 0 ; i + 4 <= desc_len ; i += 4 ) {
@@ -1584,13 +1585,13 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15841585 case 0x02 : st -> disposition |= AV_DISPOSITION_HEARING_IMPAIRED ; break ;
15851586 case 0x03 : st -> disposition |= AV_DISPOSITION_VISUAL_IMPAIRED ; break ;
15861587 }
1587- }
1588+ }
15881589#else
1590+ }
15891591 get8 (pp , desc_end );
15901592#endif
15911593 if (i ) {
15921594 language [i - 1 ] = 0 ;
1593- av_dict_set (& st -> metadata , "language" , language , 0 );
15941595 }
15951596 break ;
15961597 case 0x05 : /* registration descriptor */
@@ -1600,9 +1601,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
16001601 stream_type == STREAM_TYPE_PRIVATE_DATA )
16011602 mpegts_find_stream_type_pmt (item , dvbci -> codec_tag , REGD_types );
16021603 break ;
1604+ #if 0
16031605 case 0x52 : /* stream identifier descriptor */
16041606 st -> stream_identifier = 1 + get8 (pp , desc_end );
16051607 break ;
1608+ #endif
16061609 case DVB_BROADCAST_ID :
16071610 dvbci -> data_id = get16 (pp , desc_end );
16081611 break ;
@@ -1644,7 +1647,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
16441647 return 0 ;
16451648}
16461649
1647- static int find_in_list (const int * pids , int pid ) {
1650+ static int find_in_list (const int * pids , int pid )
1651+ {
16481652 int i ;
16491653 for (i = 0 ; i < PMT_PIDS_MAX ; i ++ )
16501654 if (pids [i ]== pid )
@@ -1657,12 +1661,12 @@ static int is_desired_stream(pmt_entry_t *item)
16571661 int val = 0 ;
16581662 switch (item -> codec_type )
16591663 {
1660- case CODEC_TYPE_VIDEO :
1661- case CODEC_TYPE_AUDIO :
1662- case CODEC_TYPE_SUBTITLE :
1664+ case AVMEDIA_TYPE_VIDEO :
1665+ case AVMEDIA_TYPE_AUDIO :
1666+ case AVMEDIA_TYPE_SUBTITLE :
16631667 val = 1 ;
16641668 break ;
1665- case CODEC_TYPE_DATA :
1669+ case AVMEDIA_TYPE_DATA :
16661670 switch (item -> codec_id )
16671671 {
16681672 case CODEC_ID_DSMCC_B :
@@ -1711,7 +1715,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
17111715
17121716 // initialize to codec_type_unknown
17131717 for (int i = 0 ; i < PMT_PIDS_MAX ; i ++ )
1714- items [i ].codec_type = CODEC_TYPE_UNKNOWN ;
1718+ items [i ].codec_type = AVMEDIA_TYPE_UNKNOWN ;
17151719
17161720 mpegts_cleanup_streams (ts ); /* in case someone else removed streams.. */
17171721
@@ -1779,7 +1783,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
17791783 }
17801784 p += program_info_length ;
17811785 if (p >= p_end )
1782- goto out ;
1786+ return ;
17831787
17841788 // stop parsing after pmt, we found header
17851789 if (!ts -> stream -> nb_streams )
@@ -1880,9 +1884,6 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
18801884 ts -> pmt_scan_state = PMT_FOUND ;
18811885 ts -> stop_parse = 1 ;
18821886 }
1883-
1884- out :
1885- av_free (mp4_dec_config_descr );
18861887}
18871888
18881889static int is_pat_same (MpegTSContext * mpegts_ctx ,
@@ -2018,7 +2019,7 @@ static void mpegts_cleanup_streams(MpegTSContext *ts)
20182019 }
20192020}
20202021
2021- static AVStream * new_section_av_stream (SectionContext * sect , enum CodecType type ,
2022+ static AVStream * new_section_av_stream (SectionContext * sect , enum AVMediaType type ,
20222023 enum CodecID id )
20232024{
20242025 FF_ALLOCZ_OR_GOTO (NULL , sect -> st , sizeof (AVStream ), fail );
@@ -2304,7 +2305,6 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
23042305 }
23052306}
23062307
2307- #if 0
23082308static void sdt_cb (MpegTSFilter * filter , const uint8_t * section , int section_len )
23092309{
23102310 MpegTSContext * ts = filter -> u .section_filter .opaque ;
@@ -2381,7 +2381,6 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
23812381 p = desc_list_end ;
23822382 }
23832383}
2384- #endif
23852384
23862385static SectionContext * add_section_stream (MpegTSContext * ts , int pid , int stream_type )
23872386{
0 commit comments