Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set default block size in FFmpegAudioFile to io.DEFAULT_BUFFER_SIZE #116

Merged
merged 3 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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