Skip to content

Commit

Permalink
Merge pull request #116 from Bomme/default_buffer_size_ffdec
Browse files Browse the repository at this point in the history
set default block size in FFmpegAudioFile to io.DEFAULT_BUFFER_SIZE
  • Loading branch information
sampsyo authored Dec 3, 2021
2 parents 39a7363 + ebc0cf5 commit bfc3fec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install ffmpeg
run: sudo apt install -y ffmpeg
run: sudo apt install -y --no-install-recommends ffmpeg
- name: Install tox and any other packages
run: pip install tox
- name: Run tox
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Version History
3.0.0
Drop support for Python 2 and older versions of Python 3. The library now
requires Python 3.6+.
Increase default block size in FFmpegAudioFile to get slightly faster file reading.

2.1.9
Work correctly with GStreamer 1.18 and later (thanks to @ssssam).
Expand Down
3 changes: 2 additions & 1 deletion audioread/ffdec.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import sys
import threading
import time
from io import DEFAULT_BUFFER_SIZE

from .exceptions import DecodeError

Expand Down Expand Up @@ -120,7 +121,7 @@ def available():

class FFmpegAudioFile:
"""An audio file decoded by the ffmpeg command-line utility."""
def __init__(self, filename, block_size=4096):
def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE):
# On Windows, we need to disable the subprocess's crash dialog
# in case it dies. Passing SEM_NOGPFAULTERRORBOX to SetErrorMode
# disables this behavior.
Expand Down

0 comments on commit bfc3fec

Please sign in to comment.