Apply new itag filter only to YouTube streams
This commit is contained in:
parent
672093ad7a
commit
7a85c08b68
3 changed files with 16 additions and 8 deletions
|
|
@ -68,12 +68,14 @@ public class AudioPlaybackResolver implements PlaybackResolver {
|
|||
*/
|
||||
@Nullable
|
||||
private Stream getAudioSource(@NonNull final StreamInfo info) {
|
||||
final List<AudioStream> audioStreams = getPlayableStreams(info.getAudioStreams());
|
||||
final List<AudioStream> audioStreams = getPlayableStreams(
|
||||
info.getAudioStreams(), info.getServiceId());
|
||||
if (!audioStreams.isEmpty()) {
|
||||
final int index = ListHelper.getDefaultAudioFormat(context, audioStreams);
|
||||
return getStreamForIndex(index, audioStreams);
|
||||
} else {
|
||||
final List<VideoStream> videoStreams = getPlayableStreams(info.getVideoStreams());
|
||||
final List<VideoStream> videoStreams = getPlayableStreams(
|
||||
info.getVideoStreams(), info.getServiceId());
|
||||
if (!videoStreams.isEmpty()) {
|
||||
final int index = ListHelper.getDefaultResolutionIndex(context, videoStreams);
|
||||
return getStreamForIndex(index, videoStreams);
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ public class VideoPlaybackResolver implements PlaybackResolver {
|
|||
|
||||
// Create video stream source
|
||||
final List<VideoStream> videoStreamsList = ListHelper.getSortedStreamVideosList(context,
|
||||
getPlayableStreams(info.getVideoStreams()),
|
||||
getPlayableStreams(info.getVideoOnlyStreams()), false, true);
|
||||
getPlayableStreams(info.getVideoStreams(), info.getServiceId()),
|
||||
getPlayableStreams(info.getVideoOnlyStreams(), info.getServiceId()), false, true);
|
||||
final int index;
|
||||
if (videoStreamsList.isEmpty()) {
|
||||
index = -1;
|
||||
|
|
@ -100,7 +100,8 @@ public class VideoPlaybackResolver implements PlaybackResolver {
|
|||
}
|
||||
|
||||
// Create optional audio stream source
|
||||
final List<AudioStream> audioStreams = getPlayableStreams(info.getAudioStreams());
|
||||
final List<AudioStream> audioStreams = getPlayableStreams(
|
||||
info.getAudioStreams(), info.getServiceId());
|
||||
final AudioStream audio = audioStreams.isEmpty() ? null : audioStreams.get(
|
||||
ListHelper.getDefaultAudioFormat(context, audioStreams));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue