aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/ffmpeg_plugin.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-01-01decoder plugins: don't include gcc.hMax Kellermann1-2/+3
Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
2008-12-24ffmpeg: case AV_NOPTS_VALUE to int64_tMax Kellermann1-2/+2
The old code casted it to a 32 bit integer, which cut off bits. AVFormatContext.duration is a int64_t, so use this type.
2008-12-24ffmpeg: don't assign "0" to pointerMax Kellermann1-1/+1
Use NULL instead. Found by sparse.
2008-12-15ffmpeg: fixing ffmpeg_send_packet to allow multipacketsViliam Mateicka1-16/+32
2008-12-15ffmpeg: adding APE supportViliam Mateicka1-2/+3
2008-11-21decoder: check audio_format_valid() in all decodersMax Kellermann1-0/+7
Refuse to play audio formats which are not supported by MPD.
2008-11-21ffmpeg: use GLib instead of log.hMax Kellermann1-8/+11
2008-11-18ffmpeg: read tags from AVFormatContextViliam Mateicka1-5/+16
The ffmpeg library provides some of the song metadata in the AVFormatContext struct. Pass it from there to MPD.
2008-11-16ffmpeg: fixed AVSEEK_SIZEMax Kellermann1-3/+9
With whence==AVSEEK_SIZE, the seek function should return the file size, not the current offset. Check the return value of input_stream_seek().
2008-11-11decoder: return void from decode() methodsMax Kellermann1-2/+2
The stream_decode() and file_decode() methods returned a boolean, indicating whether they were able to decode the song. This is redundant, since we already know that: if decoder_initialized() has been called (and dc.state==DECODE), the plugin succeeded. Change both methods to return void.
2008-11-10decoder: removed plugin method try_decode()Max Kellermann1-7/+0
Instead of having a seprate try_decode() method, let the stream_decode() and file_decode() methods decide whether they are able to decode the song.
2008-11-04decoder: removed stream_typesMax Kellermann1-1/+0
Instead of checking the stream_types bit set, we can simply check whether the methods stream_decode() and file_decode() are implemented.
2008-11-04ffmpeg: removed loop from mpd_ffmpeg_read()Max Kellermann1-15/+2
The function decoder_read() already cares about the decoder command, and loops until data is available. Reduced mpd_ffmpeg_read() to no more than the decoder_read() call.
2008-11-04ffmpeg: removed ffmpeg_context.codecMax Kellermann1-2/+0
That variable is never used except during initialization in ffmpeg_helper().
2008-11-04ffmpeg: moved code to ffmpeg_find_audio_stream()Max Kellermann1-9/+12
2008-11-04ffmpeg: no CamelCaseMax Kellermann1-100/+101
Renamed variables.
2008-11-02ffmpeg: fix boolean inversion in ffmpeg_tag()Max Kellermann1-1/+1
ffmpeg_tag() deleted the tag when ffmpeg_helper() returned success. The return value was interpreted incorrectly, it should return the tag on success.
2008-11-02ffmpeg: don't rewind stream in url_close()Max Kellermann1-4/+0
Rewinding the stream here is not useful, but may consume valuable resources (and time).
2008-11-02ffmpeg: use decoder_read() wrapper instead of direct input_stream_read()Max Kellermann1-1/+2
decoder_read() checks the decoder command. Without this patch, the ffmpeg plugin could become unresponsive.
2008-11-02ogg, ffmpeg: try to decode, even when the stream is not seekableMax Kellermann1-1/+1
Ogg and ffmpeg detection was disabled when the stream was not seekable, because the detection was too expensive. Since the curl input stream can now rewind the stream cheaply, we can re-enable detection on streams.
2008-11-02decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann1-2/+3
Don't pass the "seekable" flag with every decoder_data() invocation. Since that flag won't change within the file, it is enough to pass it to decoder_initialized() once per file.
2008-11-01decoder: make the suffixes and mime_types arrays really constMax Kellermann1-2/+2
The strings were constant, but the pointers weren't. C syntax is somewhat tricky..
2008-11-01decoder: make all decoder_plugin structs constMax Kellermann1-1/+1
All decoder_plugin structs are initialized at compile time, and must never change.
2008-10-31decoder_api: pass constant path pointersMax Kellermann1-1/+1
2008-10-30ffmpeg: pass input_stream pointer to decoder_data()Max Kellermann1-3/+5
decoder_data() uses wait times to let the input stream continue its transfer.
2008-10-30ffmpeg: use return value of decoder_data()Max Kellermann1-18/+20
decoder_data() always returns the current command. If we use this, we can save a lot of decoder_get_command() calls.
2008-10-30ffmpeg: output buffer size cannot be negativeMax Kellermann1-5/+7
Converted the runtime check to an assertion.
2008-10-30ffmpeg: break immediately after av_read_frame()Max Kellermann1-9/+8
Remove one indent level.
2008-10-30ffmpeg: moved code to ffmpeg_send_frame()Max Kellermann1-27/+34
Move code from ffmpeg_decode_internal() to make it smaller and more readable.
2008-10-30ffmpeg: report seek errors to MPDMax Kellermann1-5/+4
The decoder API provides the function decoder_seek_error() to report seek errors. Use this function instead of logging the error.
2008-10-30ffmpeg: simplified mpdurl_read()Max Kellermann1-13/+11
The function mpdurl_read() is too complicated, and uses the wrong data types.
2008-10-30ffmpeg: call tag_free() instead of free()Max Kellermann1-1/+1
tag objects must be freed with tag_free() to ensure that all resources are freed.
2008-10-30ffmpeg: eliminated local variable "tag"Max Kellermann1-7/+4
The function ffmpeg_tag() already has the variable base.tag, which can be used for this.
2008-10-30ffmpeg: make ffmpeg_helper() return boolMax Kellermann1-24/+21
ffmpeg_try_decode() did not interpret ffmpeg_helper()'s return value properly; migrate everything to bool to make it consistent.
2008-10-30ffmpeg: removed debug messagesMax Kellermann1-35/+5
We don't need those anymore, they just fill the log.
2008-10-30ffmpeg: initialize base.decoderMax Kellermann1-0/+1
ffmpeg_tag() did not initialize base.decoder, which made valgrind unhappy, and can lead to a egmentation fault.
2008-10-30decoder: use bool for return values and flagsMax Kellermann1-6/+6
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-29decoder: automatically flush the output buffer after decoder exitsMax Kellermann1-3/+0
A decoder_flush() invocation was missing in the FLAC plugin, resulting in casual assertion failures due to a wrong assumption about the last chunk's audio format. It's much easier to remove that decoder_flush() function and make the decoder thread call ob_flush().
2008-10-29decoder_api: removed decoder_clear()Max Kellermann1-1/+0
Call ob_clear() in decoder_command_finished() instead of implementing that call in every decoder plugin.
2008-10-26input_stream: use "bool" instead of "int"Max Kellermann1-1/+1
For boolean values and success flags, use bool instead of integer (1/0 for true/false, 0/-1 for success/failure).
2008-10-26input_stream: no CamelCaseMax Kellermann1-6/+6
Renamed all functions and variables.
2008-10-26input_stream: removed the InputStream typedefMax Kellermann1-7/+10
Everybody should use struct input_stream.
2008-10-26renamed src/inputPlugins/ to src/decoder/Max Kellermann1-0/+0
These plugins are not input plugins, they are decoder plugins. No CamelCase in the directory name.
2008-10-21ffmpeg: don't pass pointer as hexadecimal stringMax Kellermann1-20/+27
Casting a pointer to some sort of integer and formatting it into a string isn't valid. A pointer derived from this hex string won't work reliably. Since ffmpeg doesn't provide a nice API for passing our pointer, we have to think of a different hack: ffmpeg passes the exact URL pointer to mpdurl_open(), and we can make this string part of a struct. This reduces the problem to casting the string back to the struct. This is still a workaround, but this is "sort of portable", unless the ffmpeg people start messing with the URL pointer (which would be valid according to the API definition).
2008-10-21ffmpeg: detect which ffmpeg headers should be includedMax Kellermann1-0/+6
Since ffmpeg svn r12865, you have to include libavcodec/avcodec.h instead of avcodec.h. This cannot be checked at compile time, instead we have to add a check to configure.ac. Viliam's original ffmpeg plugin was based on the newer ffmpeg library, while my Debian installation had the older version. My attempt to correct his include statements wasn't correct after all.
2008-10-18ffmpeg: make internal functions staticMax Kellermann1-22/+12
The mpdurl_* code is internal, don't expose them. Also don't initialize struct members with NULL.
2008-10-17ffmpeg: new decoder pluginViliam Mateicka1-0/+416
[mk: fixed indent, changed copyright statement, added autoconf test, fixed includes paths, fixed 2 gcc warnings, don't close input stream twice]