Skip to content

Commit

Permalink
Remove obsolete stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksii Holub authored and Oleksii Holub committed Dec 17, 2018
1 parent af4310c commit ec91803
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions YoutubeExplode.Converter/YoutubeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace YoutubeExplode.Converter
{
/// <summary>
/// The entry point for <see cref="YoutubeExplode.Converter"/>.
/// The entry point for <see cref="Converter"/>.
/// </summary>
public class YoutubeConverter : IYoutubeConverter
{
Expand Down Expand Up @@ -76,9 +76,10 @@ await _client
.ConfigureAwait(false);
}

// Avoid transcoding if the output format and input stream formats are all mp4
var transcode = !(format == "mp4" &&
streamInfos.All(s => s.Container == Container.Mp4 || s.Container == Container.M4A));
// Transcode only if one of the input stream containers doesn't match the output format
var transcode = streamInfos
.Select(s => s.Container.GetFileExtension())
.Any(f => !string.Equals(f, format, StringComparison.OrdinalIgnoreCase));

// Set up process progress handler (20% of the total progress)
var processProgress = progressMixer?.Split(0.2);
Expand All @@ -103,8 +104,8 @@ private static IReadOnlyList<MediaStreamInfo> PickBestMediaStreamInfos(MediaStre
{
var result = new List<MediaStreamInfo>();

// Add the highest bitrate audio, prefer m4a
result.Add(set.Audio.Where(s => s.Container == Container.M4A).WithHighestBitrate() ??
// Add the highest bitrate audio, prefer mp4
result.Add(set.Audio.Where(s => s.Container == Container.Mp4).WithHighestBitrate() ??
set.Audio.WithHighestBitrate());

// Check if needs video
Expand Down

0 comments on commit ec91803

Please sign in to comment.