Skip to content

Commit

Permalink
Readme fix: Open -> Create, buffering notes (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: Ilya Barbashov <[email protected]>
  • Loading branch information
barbashov and Ilya Barbashov authored Mar 27, 2021
1 parent cba29b6 commit df3794c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ go func() {
}()

// Open your file or initialize any kind of io.Reader
// Buffering using bufio.Reader is recommended for performance
f, _ := os.Open("/path/to/file.ts")
defer f.Close()

Expand Down Expand Up @@ -92,8 +93,9 @@ go func() {
cancel()
}()

// Open your file or initialize any kind of io.Writer
f, _ := os.Open("/path/to/file.ts")
// Create your file or initialize any kind of io.Writer
// Buffering using bufio.Writer is recommended for performance
f, _ := os.Create("/path/to/file.ts")
defer f.Close()

// Create the muxer
Expand All @@ -106,6 +108,7 @@ mx.AddElementaryStream(astits.PMTElementaryStream{
})

// Write tables
// Using that function is not mandatory, WriteData will retransmit tables from time to time
mx.WriteTables()

// Write data
Expand Down

0 comments on commit df3794c

Please sign in to comment.