File tree 1 file changed +20
-10
lines changed
1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -64,24 +64,34 @@ shaka.media.SegmentUtils = class {
64
64
switch ( tsCodecs . audio ) {
65
65
case 'aac' :
66
66
case 'aac-loas' :
67
- codecs . push ( 'mp4a.40.2' ) ;
68
- hasAudio = true ;
67
+ if ( tsParser . getAudioData ( ) . length ) {
68
+ codecs . push ( 'mp4a.40.2' ) ;
69
+ hasAudio = true ;
70
+ }
69
71
break ;
70
72
case 'mp3' :
71
- codecs . push ( 'mp4a.40.34' ) ;
72
- hasAudio = true ;
73
+ if ( tsParser . getAudioData ( ) . length ) {
74
+ codecs . push ( 'mp4a.40.34' ) ;
75
+ hasAudio = true ;
76
+ }
73
77
break ;
74
78
case 'ac3' :
75
- codecs . push ( 'ac-3' ) ;
76
- hasAudio = true ;
79
+ if ( tsParser . getAudioData ( ) . length ) {
80
+ codecs . push ( 'ac-3' ) ;
81
+ hasAudio = true ;
82
+ }
77
83
break ;
78
84
case 'ec3' :
79
- codecs . push ( 'ec-3' ) ;
80
- hasAudio = true ;
85
+ if ( tsParser . getAudioData ( ) . length ) {
86
+ codecs . push ( 'ec-3' ) ;
87
+ hasAudio = true ;
88
+ }
81
89
break ;
82
90
case 'opus' :
83
- codecs . push ( 'opus' ) ;
84
- hasAudio = true ;
91
+ if ( tsParser . getAudioData ( ) . length ) {
92
+ codecs . push ( 'opus' ) ;
93
+ hasAudio = true ;
94
+ }
85
95
break ;
86
96
}
87
97
}
You can’t perform that action at this time.
0 commit comments