mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Implement IAudioSource.Duration property and IAudioDecoderSettings.Open extension method.
This commit is contained in:
@@ -7,11 +7,6 @@ namespace CUETools.Codecs.MPEG.MPLS
|
||||
{
|
||||
public class AudioDecoder : IAudioSource
|
||||
{
|
||||
public unsafe AudioDecoder(string path, Stream IO, ushort pid)
|
||||
: this(new DecoderSettings() { StreamId = pid }, path, IO)
|
||||
{
|
||||
}
|
||||
|
||||
public unsafe AudioDecoder(DecoderSettings settings, string path, Stream IO)
|
||||
{
|
||||
m_settings = settings;
|
||||
@@ -33,7 +28,7 @@ namespace CUETools.Codecs.MPEG.MPLS
|
||||
|
||||
void openEntries()
|
||||
{
|
||||
readers = new List<BDLPCM.AudioDecoder>();
|
||||
readers = new List<IAudioSource>();
|
||||
var pids = new List<int>();
|
||||
foreach (var item in hdr_m.play_item)
|
||||
foreach (var audio in item.audio)
|
||||
@@ -67,7 +62,8 @@ namespace CUETools.Codecs.MPEG.MPLS
|
||||
var m2ts = System.IO.Path.Combine(
|
||||
System.IO.Path.Combine(parent.FullName, "STREAM"),
|
||||
item.clip_id + ".m2ts");
|
||||
var entry = new BDLPCM.AudioDecoder(m2ts, null, chosenPid);
|
||||
var settings = new BDLPCM.DecoderSettings() { StreamId = chosenPid };
|
||||
var entry = settings.Open(m2ts);
|
||||
readers.Add(entry);
|
||||
break;
|
||||
}
|
||||
@@ -434,8 +430,8 @@ namespace CUETools.Codecs.MPEG.MPLS
|
||||
byte[] contents;
|
||||
|
||||
AudioPCMConfig pcm;
|
||||
List<BDLPCM.AudioDecoder> readers;
|
||||
BDLPCM.AudioDecoder currentReader;
|
||||
List<IAudioSource> readers;
|
||||
IAudioSource currentReader;
|
||||
MPLSHeader hdr_m;
|
||||
DecoderSettings m_settings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user