Skip to content

Commit

Permalink
Fix regressions in the form of CA2101
Browse files Browse the repository at this point in the history
  • Loading branch information
nixxquality committed May 16, 2014
1 parent a000930 commit eb745f3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions FFMSsharp/Index.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ public int NumberOfTracks
/// <exception cref="NotSupportedException">Trying to read an index file for a <see cref="Source">Source</see> that is not available in the ffms2.dll.</exception>
public Index(string indexFile)
{
if (indexFile == null)
throw new ArgumentNullException("indexFile");

FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
err.Buffer = new String((char)0, 1024);
Expand Down Expand Up @@ -387,6 +390,9 @@ public int GetFirstIndexedTrackOfType(TrackType type)
/// <exception cref="System.IO.IOException">Failure to write the index</exception>
public void WriteIndex(string indexFile)
{
if (indexFile == null)
throw new ArgumentNullException("indexFile");

FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
err.Buffer = new String((char)0, 1024);
Expand Down Expand Up @@ -414,6 +420,9 @@ public void WriteIndex(string indexFile)
/// <returns>True or false depending on the result</returns>
public bool BelongsToFile(string sourceFile)
{
if (sourceFile == null)
throw new ArgumentNullException("sourceFile");

FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
err.Buffer = new String((char)0, 1024);
Expand Down Expand Up @@ -459,6 +468,9 @@ public bool BelongsToFile(string sourceFile)
/// <exception cref="InvalidOperationException">Supplying the wrong <paramref name="sourceFile"/></exception>
public VideoSource VideoSource(string sourceFile, int track, int threads = 1, SeekMode seekMode = SeekMode.Normal)
{
if (sourceFile == null)
throw new ArgumentNullException("sourceFile");

IntPtr videoSource = IntPtr.Zero;
FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
Expand Down Expand Up @@ -502,6 +514,9 @@ public VideoSource VideoSource(string sourceFile, int track, int threads = 1, Se
/// <exception cref="InvalidOperationException">Supplying the wrong <paramref name="sourceFile"/></exception>
public AudioSource AudioSource(string sourceFile, int track, AudioDelayMode delayMode = AudioDelayMode.FirstVideoTrack)
{
if (sourceFile == null)
throw new ArgumentNullException("sourceFile");

IntPtr audioSource = IntPtr.Zero;
FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
Expand Down
3 changes: 3 additions & 0 deletions FFMSsharp/Indexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ public string FormatName
/// <exception cref="System.IO.FileLoadException">Failure to load the media file</exception>
public Indexer(string sourceFile, Source demuxer = Source.Default)
{
if (sourceFile == null)
throw new ArgumentNullException("sourceFile");

FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
err.Buffer = new String((char)0, 1024);
Expand Down
3 changes: 3 additions & 0 deletions FFMSsharp/Track.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ internal Track(IntPtr Track)
/// <exception cref="System.IO.IOException">Failure to open or write to the file</exception>
public void WriteTimecodes(string timecodeFile)
{
if (timecodeFile == null)
throw new ArgumentNullException("timecodeFile");

FFMS_ErrorInfo err = new FFMS_ErrorInfo();
err.BufferSize = 1024;
err.Buffer = new String((char)0, 1024);
Expand Down

0 comments on commit eb745f3

Please sign in to comment.