platform/upstream/lightmediascanner.git
10 years agowave: provide dlna information.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 16:24:11 +0000 (13:24 -0300)]
wave: provide dlna information.

10 years agoasf: : provide dlna information for wma.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:36:31 +0000 (12:36 -0300)]
asf: : provide dlna information for wma.

10 years agoid3: provide dlna information.
Gustavo Sverzut Barbieri [Wed, 28 Aug 2013 00:15:45 +0000 (21:15 -0300)]
id3: provide dlna information.

10 years agopng: provide dlna information.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:51:06 +0000 (18:51 -0300)]
png: provide dlna information.

10 years agojpeg: provide dlna information.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:50:45 +0000 (18:50 -0300)]
jpeg: provide dlna information.

10 years agoadd dlna fields to video table.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:28:58 +0000 (12:28 -0300)]
add dlna fields to video table.

Add new fields dlna_profile and dlna_mime to provide simple
information for applications that use it.

10 years agoasf: better bitrate for variable bit rate.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:33:30 +0000 (12:33 -0300)]
asf: better bitrate for variable bit rate.

The spec says the following:

 Alternate Data Bitrate:

    Specifies the leak rate RAlt, in bits per second, of a leaky
    bucket that contains the data portion of the stream without
    overflowing, excluding all ASF Data Packet overhead. The size of
    the leaky bucket is specified by the value of the Alternate Buffer
    Size field. This value is relevant in most scenarios where the bit
    rate is not exactly constant, but it is especially useful for
    streams that have highly variable bit rates. This field can
    optionally be set to the same value as the Data Bitrate field.

 Alternate Buffer Size:

    Specifies the size BAlt, in milliseconds, of the leaky bucket used
    in the Alternate Data Bitrate definition. This value is relevant
    in most scenarios where the bit rate is not exactly constant, but
    it is especially useful for streams that have highly variable bit
    rates. This field can optionally be set to the same value as the
    Buffer Size field.

 Alternate Initial Buffer Fullness:

    Specifies the initial fullness, in milliseconds, of the leaky
    bucket used in the Alternate Data Bitrate definition. This is the
    fullness of the buffer at the instant before the first bit in the
    stream is dumped into the bucket. Typically, this value is set to
    0. This value shall not exceed the value of the Alternate Buffer
    Size field.

10 years agodb_audio: add dlna_mime column.
Gustavo Sverzut Barbieri [Wed, 28 Aug 2013 00:14:35 +0000 (21:14 -0300)]
db_audio: add dlna_mime column.

this column pairs with dlna_profile.

10 years agoadd dlna fields to image table.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:50:05 +0000 (18:50 -0300)]
add dlna fields to image table.

Add new fields dlna_profile and dlna_mime to provide simple
information for applications that use it.

10 years agoadd lightmediascannerd and lightmediascannerctl
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 03:37:50 +0000 (00:37 -0300)]
add lightmediascannerd and lightmediascannerctl

The daemon and control client are provided as a way to make usage of
lightmediascanner easier in a platform. It will scan directories based
on the startup configuration of categories, their parsers and
directories.

One can request a write lock, avoiding the server to scan and also
report to others that they should not write to DB.

Scanning status, Write Lock and global Update ID are provided as
properties.

The scan method will take a dict of categories and their respective
scan paths. This allows to reduce the scan scope to just few
categories and paths. The categories must exist previously and paths
must be inside the previously known categories directories, this
avoids people doing mistakes. If a category is provided as an empty
list, all directories will be used. If there are no categories
provided, then all categories with all directories will be used.

10 years agoallow scanning a single file instead of a directory.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 18:21:37 +0000 (15:21 -0300)]
allow scanning a single file instead of a directory.

The previous code assumed we always scan a directory, this is
cumbersome if we know just one file changed and want to scan only that
instance and not the whole dir recursively.

It is now allowed to check a non-existent directory or file, this will
mark any existing entry as deleted in the database.

10 years agoplugins/id3: Add loop on frames to estimate bitrate
Lucas De Marchi [Fri, 30 Aug 2013 14:20:29 +0000 (11:20 -0300)]
plugins/id3: Add loop on frames to estimate bitrate

Estimate the bitrate and length when there's no additional header we
can rely on to get these numbers. This is done by parsing the initial
frames of the file.

This has an impact on performance, since now we are parsing much more
than before. There's a define N_FRAMES_BITRATE_ESTIMATE and
N_FRAMES_CBR_ESTIMATE that need to be tuned in order to obtain the best
compromise between performance and accuracy.

10 years agoplugins/id3: parse VBR headers
Lucas De Marchi [Thu, 29 Aug 2013 12:51:07 +0000 (09:51 -0300)]
plugins/id3: parse VBR headers

Parse VBR headers: Xing and VBRI. We use the number of frames and stream
size we find in these headers in order to calculate length and bitrate.

We also parse the "Info" header, which is the same as "Xing", but in
this case we assume the file has constant bitrate.

Now the only case in which bitrate is wrong is when the file is VBR but
it has no headers to indicate so.

10 years agoplugins/id3: Add bitrate and length for CBR files
Lucas De Marchi [Wed, 28 Aug 2013 14:05:51 +0000 (11:05 -0300)]
plugins/id3: Add bitrate and length for CBR files

10 years agoplugins/id3: Fix id3v2 not skipping CRC if present
Lucas De Marchi [Wed, 28 Aug 2013 21:45:55 +0000 (18:45 -0300)]
plugins/id3: Fix id3v2 not skipping CRC if present

If there's a CRC field after the extended header, we need to skip it,
too. The worst thing that could happen here is the CRC containing a sync
byte and having no other frames in the ID3v2. In this case our parser
would not find correct mp3 information.

10 years agoplugins/id3: Fix id3v2 header size calculation
Lucas De Marchi [Wed, 28 Aug 2013 04:24:35 +0000 (01:24 -0300)]
plugins/id3: Fix id3v2 header size calculation

_parse_id3v2() was not getting the size of the frame correctly. Since
the number uses at most 7 bits, we can't use _to_uint() function. For
example, 0x00000201 should be translated as 257, not 513.

We were also relying on _parse_id3v2() letting the fd in the right
position to look for the sync byte. However if this function read too
little and ave up parsing we were left in the middle of some ID3 frame.
Also, if there are other mistakes in the tag, we could end up reading
too much and losing the first sync byte.

Be safe and skip the amount of bytes as written into the ID3 header (or
skip just the ID3 tag if _parse_id3v2() fails badly).

We also skip the extended header if it exists and rename the
syncframe_offset to sync_offset everywhere.

Reference: Section 3.1 of ID3v2 tag specification
(http://id3.org/id3v2.3.0)

10 years agoplugins/id3: Add references and fix typo
Lucas De Marchi [Wed, 28 Aug 2013 04:20:34 +0000 (01:20 -0300)]
plugins/id3: Add references and fix typo

10 years agoplugins/ogg: Add support for theora videos
Lucas De Marchi [Tue, 27 Aug 2013 21:22:47 +0000 (18:22 -0300)]
plugins/ogg: Add support for theora videos

This adds support for theora videos, with all the fields being filled
in, possibly with several streams.

For now we link to libtheoradec to do this. However it seems a little
bit overkill linking to libvorbis and libtheora. There can also be other
codecs inside ogg, which we don't currently support.

It would be good (but a little more difficult) to stop using them and
parse the file by ourselves. In this scenario the use of libogg would
remain so we get page/packet separation while doing the codec part.

10 years agoplugins/ogg: Refactor to conquer
Lucas De Marchi [Tue, 27 Aug 2013 04:56:43 +0000 (01:56 -0300)]
plugins/ogg: Refactor to conquer

  * Add reference links
  * Parse all streams in a file - we only consider the first one
    regarding audio files, but this paves the way to support video
    (which has never been supported in ogg plugin)
  * Split the file parsing into pages/packets/codec-data. This makes it
    easier to support theora (needed for video) and also for removing
    libvorbis if it's desired in the future
  * Be safer regarding packets crossing page boundaries
  * Be safer regarding EOF in the middle of parsing

10 years agoTODO: Update with pread/preadv/readv
Lucas De Marchi [Fri, 23 Aug 2013 17:45:48 +0000 (14:45 -0300)]
TODO: Update with pread/preadv/readv

10 years agoplugins/asf: Parse extended stream properties
Lucas De Marchi [Fri, 23 Aug 2013 00:23:38 +0000 (21:23 -0300)]
plugins/asf: Parse extended stream properties

Parsing the Extended Stream Properties Object we can get the framerate
and bitrate of each stream. Also, since ASF allows the "Stream
Properties Object" to be embedded inside the extension with this code
we make sure we are getting all the streams that are possible in a ASF
file.

10 years agoutil: Add functions to do 64 bits endiannes conversion
Lucas De Marchi [Thu, 22 Aug 2013 20:27:02 +0000 (17:27 -0300)]
util: Add functions to do 64 bits endiannes conversion

10 years agoplugins/asf: Fix header_extension_guid
Lucas De Marchi [Wed, 21 Aug 2013 23:59:24 +0000 (20:59 -0300)]
plugins/asf: Fix header_extension_guid

10 years agoplugins/asf: Add length for videos
Lucas De Marchi [Wed, 21 Aug 2013 23:01:09 +0000 (20:01 -0300)]
plugins/asf: Add length for videos

10 years agoshared: Add constants for time conversions
Lucas De Marchi [Wed, 21 Aug 2013 22:51:38 +0000 (19:51 -0300)]
shared: Add constants for time conversions

10 years agoplugins/asf: Refactor to conquer
Lucas De Marchi [Wed, 21 Aug 2013 22:42:16 +0000 (19:42 -0300)]
plugins/asf: Refactor to conquer

  * Move fields inside asf_info: streams, length, type. They are fields
    important both to audio and video files

  * Pass asf_info around to frame parsers: we only decide if it's audio
    or video later, when all important frames are already parsed

  * Try not to reach 80 cols in some places

  * Move code to free streams to its own function

  * Remove useless #if 0 code

  * Check if we parsed any stream. Would be a violation of the format if
    info.streams was NULL in the end, but at least we don't crash

10 years agoplugins/asf: Add TODO
Lucas De Marchi [Wed, 21 Aug 2013 22:01:15 +0000 (19:01 -0300)]
plugins/asf: Add TODO

10 years agoplugins/asf: add aspect ratio
Lucas De Marchi [Wed, 21 Aug 2013 21:06:39 +0000 (18:06 -0300)]
plugins/asf: add aspect ratio

10 years agoutil: add function to calculate aspect ratio
Lucas De Marchi [Wed, 21 Aug 2013 20:52:44 +0000 (17:52 -0300)]
util: add function to calculate aspect ratio

To calculate the aspect ratio what we need to do is to calculate the gcd
of width and height, dividing by it. We use the simple Euclidean
algorithm. Besides of being simple it's pretty fast.

10 years agoplugins/asf: add codec, width and height
Lucas De Marchi [Wed, 21 Aug 2013 20:23:47 +0000 (17:23 -0300)]
plugins/asf: add codec, width and height

10 years agoplugins/asf: add all streams on video
Lucas De Marchi [Wed, 21 Aug 2013 15:53:03 +0000 (12:53 -0300)]
plugins/asf: add all streams on video

We use the heuristic that a file is of audio type if it contains only
audio streams, otherwise it's considered as video. However now we add
all the audio/video streams to the database. It suffices to just set the
streams pointer since we are already allocating/freeing as we should.

10 years agoplugins/asf: add audio prefix to symbols
Lucas De Marchi [Wed, 21 Aug 2013 15:38:29 +0000 (12:38 -0300)]
plugins/asf: add audio prefix to symbols

10 years agoplugins/rm: use common type for stream
Lucas De Marchi [Wed, 21 Aug 2013 03:24:56 +0000 (00:24 -0300)]
plugins/rm: use common type for stream

10 years agoplugins/mp4: use common type for stream
Lucas De Marchi [Wed, 21 Aug 2013 03:21:59 +0000 (00:21 -0300)]
plugins/mp4: use common type for stream

10 years agoplugins/asf: use common types for streams
Lucas De Marchi [Wed, 21 Aug 2013 03:19:29 +0000 (00:19 -0300)]
plugins/asf: use common types for streams

10 years agoplugins/asf: Add reference link
Lucas De Marchi [Tue, 20 Aug 2013 22:12:27 +0000 (19:12 -0300)]
plugins/asf: Add reference link

10 years agoAdd video substreams if available
Lucas De Marchi [Tue, 20 Aug 2013 22:09:12 +0000 (19:09 -0300)]
Add video substreams if available

10 years agodb: Create tables for each video substream
Lucas De Marchi [Mon, 19 Aug 2013 13:59:01 +0000 (10:59 -0300)]
db: Create tables for each video substream

10 years agotest: Fix leaking stmt
Lucas De Marchi [Wed, 21 Aug 2013 17:31:11 +0000 (14:31 -0300)]
test: Fix leaking stmt

Let's call sqlite3_finalize() on stmt so resources are freed and we
don't leak it:

==11116== 107,752 (856 direct, 106,896 indirect) bytes in 1 blocks are definitely lost in loss record 84 of 84
==11116==    at 0x4C2757B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11116==    by 0x5076816: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x5052889: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x505A6C7: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x505A6EC: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x50D27F0: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x401F22: show (test.c:377)
==11116==    by 0x401913: main (test.c:481)

10 years agobuild: Enable warning flags for bin/
Lucas De Marchi [Mon, 19 Aug 2013 17:19:25 +0000 (14:19 -0300)]
build: Enable warning flags for bin/

10 years agoplugins/rm: Add reference link
Lucas De Marchi [Fri, 16 Aug 2013 18:31:50 +0000 (15:31 -0300)]
plugins/rm: Add reference link

10 years agoGet rid of [BL]E_[24]BYTE macros
Lucas De Marchi [Thu, 15 Aug 2013 17:36:05 +0000 (14:36 -0300)]
Get rid of [BL]E_[24]BYTE macros

Use either libc functions from endian.h (when we have the value instead
of a position in buffer) or common provided functions in util.h

10 years agoplugins: Use shared function to add fallback name
Lucas De Marchi [Wed, 14 Aug 2013 23:55:59 +0000 (20:55 -0300)]
plugins: Use shared function to add fallback name

10 years agoshared: Add function to extract fallback name from path
Lucas De Marchi [Wed, 14 Aug 2013 23:06:46 +0000 (20:06 -0300)]
shared: Add function to extract fallback name from path

10 years agoplugins/wave: Add metadata fields
Lucas De Marchi [Wed, 14 Aug 2013 16:31:47 +0000 (13:31 -0300)]
plugins/wave: Add metadata fields

Parse title, artist, album and genre from INFO chunk.

10 years agoplugins/wave: Add channels, bitrate, sampling rate, container
Lucas De Marchi [Wed, 14 Aug 2013 14:40:38 +0000 (11:40 -0300)]
plugins/wave: Add channels, bitrate, sampling rate, container

10 years agoAdd util header
Lucas De Marchi [Tue, 13 Aug 2013 23:17:19 +0000 (20:17 -0300)]
Add util header

For now, endiannes conversions and getter for unaligned memory.

10 years agobuild: define extension macros in config.h
Lucas De Marchi [Tue, 13 Aug 2013 21:17:48 +0000 (18:17 -0300)]
build: define extension macros in config.h

Instead of defining _GNU_SOURCE and friends in each source file (and
potentially forgetting in some), tell the build system we use
extensions and let it define them in config.h.

10 years agobuild: Get rid of #ifdef HAVE_CONFIG_H
Lucas De Marchi [Tue, 13 Aug 2013 21:14:43 +0000 (18:14 -0300)]
build: Get rid of #ifdef HAVE_CONFIG_H

10 years agoplugins: Add empty wave plugin
Lucas De Marchi [Tue, 13 Aug 2013 20:37:03 +0000 (17:37 -0300)]
plugins: Add empty wave plugin

This is just like the audio-dummy, which will serve as a skeleton for
the implementation of the wave plugin

10 years agoplugins/rm: Use mime type to decide if it's audio
Lucas De Marchi [Tue, 13 Aug 2013 04:59:36 +0000 (01:59 -0300)]
plugins/rm: Use mime type to decide if it's audio

10 years agoplugins/rm: Parse MDPR header and its subheaders
Lucas De Marchi [Tue, 13 Aug 2013 04:50:27 +0000 (01:50 -0300)]
plugins/rm: Parse MDPR header and its subheaders

Interesting fields: sampling rate, codec, channels

10 years agoutils: Add cast to string size initializer
Lucas De Marchi [Tue, 13 Aug 2013 04:47:40 +0000 (01:47 -0300)]
utils: Add cast to string size initializer

10 years agoplugins/rm: Parse PROP header
Lucas De Marchi [Mon, 12 Aug 2013 23:32:33 +0000 (20:32 -0300)]
plugins/rm: Parse PROP header

This header contains the following interesting fields: duration and
avg_bit_rate.

10 years agoplugins/rm: Simplify loop, searching for CONT header
Lucas De Marchi [Mon, 12 Aug 2013 18:29:12 +0000 (15:29 -0300)]
plugins/rm: Simplify loop, searching for CONT header

Call _read_header_type_and_size() in only one place and make
_parse_cont_header() return the number of bytes read, so we can seek to
the right place later.

10 years agoTODO: Add entry about buffered, unbuffered, mmap for plugins
Lucas De Marchi [Mon, 12 Aug 2013 18:20:08 +0000 (15:20 -0300)]
TODO: Add entry about buffered, unbuffered, mmap for plugins

10 years agoplugins/ogg: Add support to new fields
Lucas De Marchi [Mon, 12 Aug 2013 17:10:28 +0000 (14:10 -0300)]
plugins/ogg: Add support to new fields

New fields are supported for ogg vorbis:
* container: Always the same: ogg
* codec: Although ogg may contain streams encoded by other
  codecs we never supported them. They will fail to parse when
  we try to create the vorbis structs. Therefore for now this is
  statically set to "vorbis"
* bitrate, sampling rate, channels: As extracted from the
  vorbis header

10 years agoplugins/ogg: Fix leaking comment on error path
Lucas De Marchi [Mon, 12 Aug 2013 14:53:05 +0000 (11:53 -0300)]
plugins/ogg: Fix leaking comment on error path

We need to call vorbis_comment_clear() on error path.

10 years agoDo not use {0} struct initializers
Lucas De Marchi [Mon, 12 Aug 2013 14:00:15 +0000 (11:00 -0300)]
Do not use {0} struct initializers

Change code all over the tree with the following command, and fix up the
one false positive:

git ls-files | while read f; do sed -i 's/ = { *0.*}/ = { }/g' $f; done

10 years agoGet rid of "if (bla) free(bla);"
Lucas De Marchi [Fri, 9 Aug 2013 21:07:14 +0000 (18:07 -0300)]
Get rid of "if (bla) free(bla);"

Patch generated with the following coccinelle semantic patch:

@r@
expression E;
@@

- if (E)
- free(E);
+ free(E);

10 years agoplugins/asf: Add codec support
Lucas De Marchi [Fri, 9 Aug 2013 18:51:50 +0000 (15:51 -0300)]
plugins/asf: Add codec support

ASF as other containers may contain streams encoded in several other
codecs. Maybe we should have a global list/hash-table with all the
possible { ID: name }? Meanwhile, put the more important codecs there
for this specific format.

10 years agoplugins/asf: Add channels, bitrate, sampling_rate
Lucas De Marchi [Fri, 9 Aug 2013 17:49:23 +0000 (14:49 -0300)]
plugins/asf: Add channels, bitrate, sampling_rate

10 years agoplugins/asf: Fix overriding type - parse multiple streams
Lucas De Marchi [Fri, 9 Aug 2013 14:46:51 +0000 (11:46 -0300)]
plugins/asf: Fix overriding type - parse multiple streams

ASF files may contain more than one stream, with more than one type.
Previously if there was a video stream after an audio stream, we would
overwrite the type.

Prepare to support multiple streams and parse all of them. If there's
any video stream, register it. Otherwise, take the first stream.

10 years agoplugins/asf: Add container
Lucas De Marchi [Fri, 9 Aug 2013 14:44:13 +0000 (11:44 -0300)]
plugins/asf: Add container

And change a littler bit the coding style:
 * else on the same line as the previous "}"
 * no need to to "if (bla) free bla;"

10 years agoplugins/asf: No need to overly complicate skipping attributes
Lucas De Marchi [Thu, 8 Aug 2013 21:34:27 +0000 (18:34 -0300)]
plugins/asf: No need to overly complicate skipping attributes

We have no interest in the extension header. Skip it entirely instead of
parsing field by field and skipping them individually.

10 years agoplugins/asf: Add length field
Lucas De Marchi [Thu, 8 Aug 2013 19:14:13 +0000 (16:14 -0300)]
plugins/asf: Add length field

10 years agoplugins/flac: Add new fields
Lucas De Marchi [Thu, 8 Aug 2013 16:15:24 +0000 (13:15 -0300)]
plugins/flac: Add new fields

New fields: length, bitrate, codec, container, sampling_rate, channels.

Bitrate may be a little bit higher than the actual bitrate since we
calculate it as (filesize * 8)/length. I.e. header/coverart are also
accounted.

We could start using the lower level decoder APIs of libflac, so we
don't have to open the file twice to parse metadata + streaminfo.
However benchmarks show it's not that relevant performance-wise.

10 years agoplugins/id3: we parse adts files as well
Lucas De Marchi [Wed, 7 Aug 2013 19:35:05 +0000 (16:35 -0300)]
plugins/id3: we parse adts files as well

.adts files are the same as .aac, but usually without ID3.

10 years agoplugins: Turn on warnings
Lucas De Marchi [Wed, 7 Aug 2013 15:57:20 +0000 (12:57 -0300)]
plugins: Turn on warnings

Turn on the same compiler warnings that were on for the library and fix
the issues.

  * signed/unsigned comparison
  * Missing function prototype
  * constify lms_plugin_info
  * Missing struct initializers (actually remove all of them)
  * Fix LMS_STATIC_STRING_SIZE to cast to char* since lms_string_size is
    declared with 'char *str' and we can't really change it (otherwise
    in other places it would not be able to change the
    string in place

Warnings like this in mp4 plugin is not fixed:
mp4/mp4.c:120:5: warning: implicit declaration of function
'MP4GetMetadataName' [-Wimplicit-function-declaration]
     MP4GetMetadataName(mp4_fh, &info.title.str);

This happens because MP4v2 lib deprecated the use of these functions in
favor to another MP4Tags*() API. Let this warning as is so we remember
to change this code.

10 years agogitignore: Add cscope.{out,files}
Lucas De Marchi [Wed, 7 Aug 2013 15:15:05 +0000 (12:15 -0300)]
gitignore: Add cscope.{out,files}

10 years agobuild: Unrecurse plugins' build
Lucas De Marchi [Wed, 7 Aug 2013 00:10:36 +0000 (21:10 -0300)]
build: Unrecurse plugins' build

10 years agoMake build warnings-aware
Lucas De Marchi [Tue, 6 Aug 2013 22:50:24 +0000 (19:50 -0300)]
Make build warnings-aware

Enable common warnings by default for the library. In order to enable it
for plugins it's better to first convert the build-sys to make it not
recursive.

10 years agoplugins/id3: Add new fields
Lucas De Marchi [Tue, 6 Aug 2013 22:21:21 +0000 (19:21 -0300)]
plugins/id3: Add new fields

Add codec, sampling rate and channels. Container is left empty on
purpose since .mp3 and .aac files are not inside a container per se. We
may want to split the _codecs table later and put the first part as the
container.

We also have basic support for AAC file in a MPEG 4 file, since it's
almost the same of an MPEG2 one.

We only parse audio parameter fields for the ones with ADTS header.
Adding support for ADIF shall be trivial in the future. The current code
find the ID3v2 tag is actually doing more than it needed. The only case
in which the ID3 tag would not be in the start of the file is if there
was an ADIF tag first. But then the header has a fixed size and we
shouldn't need to use a ring buffer of 3 chars. When adding support to
ADIF we may want to kill useless code.

Regarding the supported codecs, we support all the
mpeg{1,2,2.5,3}layer{1,2,3} values. For AAC there's MAIN, LC, SSR and
LTP. Both for MPEG 2 and 4.

10 years agoplugins/id3: use designated initializers
Lucas De Marchi [Fri, 2 Aug 2013 21:10:05 +0000 (18:10 -0300)]
plugins/id3: use designated initializers

It's a pain to add more fields to structs that initialized their fields
like this.

10 years agoaudio: use inttypes.h and reorder fields
Lucas De Marchi [Fri, 2 Aug 2013 20:27:09 +0000 (17:27 -0300)]
audio: use inttypes.h and reorder fields

We don't have versioning in plugins' structs, so plugins must be
updated.

10 years agoaudio: use a macro to bind values
Lucas De Marchi [Mon, 5 Aug 2013 14:10:12 +0000 (11:10 -0300)]
audio: use a macro to bind values

When adding new fields it's too easy to mistakenly call a
lms_db_bind_*() function and forget to update the column which were are
binding to.

10 years agoaudio: Allow plugins to update new fields
Lucas De Marchi [Fri, 2 Aug 2013 20:19:19 +0000 (17:19 -0300)]
audio: Allow plugins to update new fields

We don't have versioning in plugins' structs, so plugins must be
updated.

10 years agoaudio: Add new fields in its table
Lucas De Marchi [Mon, 29 Jul 2013 21:29:38 +0000 (18:29 -0300)]
audio: Add new fields in its table

10 years agoSet update_id when checking files
Lucas De Marchi [Thu, 1 Aug 2013 03:58:00 +0000 (00:58 -0300)]
Set update_id when checking files

10 years agoSet update_id when processing files
Lucas De Marchi [Thu, 1 Aug 2013 03:57:14 +0000 (00:57 -0300)]
Set update_id when processing files

10 years agoPass the entire pinfo to the slave
Lucas De Marchi [Tue, 30 Jul 2013 23:36:43 +0000 (20:36 -0300)]
Pass the entire pinfo to the slave

The worker process already needs 2 fields that comes from pinfo when the
process is forked. There's no reason lms_create_slave() and
lms_restart_slave() should keep the rest of the information private.
Since the worker process will require the update_id that also comes from
this struct, pass the entire struct.

10 years agoAdd helper method to update the global update_id
Lucas De Marchi [Tue, 30 Jul 2013 21:47:46 +0000 (18:47 -0300)]
Add helper method to update the global update_id

update_id is saved in lms_internal, but it's not a table versioning like
other entries.

10 years agoAllow to set update_id field in files table
Lucas De Marchi [Tue, 30 Jul 2013 21:43:39 +0000 (18:43 -0300)]
Allow to set update_id field in files table

10 years agoAdd update_id to files table
Lucas De Marchi [Mon, 29 Jul 2013 22:31:13 +0000 (19:31 -0300)]
Add update_id to files table

10 years agoFix treating up-to-date files as processed
Lucas De Marchi [Wed, 31 Jul 2013 21:43:40 +0000 (18:43 -0300)]
Fix treating up-to-date files as processed

If the file didn't change its mtime and size we shouldn't treat it
otherwise. Previously we would:

  1) Call the callback with reply==PROCESSED
  2) Increment the number of commits to the database. This could
     end with situations like: "BEGIN TRANSACTION; COMMIT;", without
     any operation if no file changed at all.

10 years agoFix using wrong stmt size column
Lucas De Marchi [Wed, 31 Jul 2013 07:08:50 +0000 (04:08 -0300)]
Fix using wrong stmt size column

_update_finfo_from_stmt() was using the wrong size column as the
information about file size. This makes lms_check* always considering
the file as changed, since the size will try to match with the wrong
column.

10 years agobuild: Hide plugins symbols by default
Lucas De Marchi [Wed, 31 Jul 2013 06:09:11 +0000 (03:09 -0300)]
build: Hide plugins symbols by default

Only export the symbols that are meant to be exported with the proper
use of API

10 years agobuild: Avoid building and installing static plugin
Lucas De Marchi [Wed, 31 Jul 2013 05:46:12 +0000 (02:46 -0300)]
build: Avoid building and installing static plugin

There's no need to build and install a static plugin. So, disable it
(only for plugins).

10 years agobuild: modernize build
Lucas De Marchi [Wed, 31 Jul 2013 05:34:09 +0000 (02:34 -0300)]
build: modernize build

  - Use subdir-objects
  - Don't keep INSTALL file on tree. It's a pain that it's updated
    everytime we build the source
  - ChangeLog is more like a NEWS file. ChangeLog can be retrieved from
    git
  - Don't dist autogen.sh since it's intended for devs

11 years agorelease 0.4.5 with mp4v2 2.0 api support. release_0.4.5
Gustavo Sverzut Barbieri [Fri, 6 Jul 2012 14:24:40 +0000 (11:24 -0300)]
release 0.4.5 with mp4v2 2.0 api support.

11 years agomp4: support 2.0 mp4v2 API changes.
Gustavo Sverzut Barbieri [Thu, 5 Jul 2012 16:37:47 +0000 (13:37 -0300)]
mp4: support 2.0 mp4v2 API changes.

The function signature changed:
 * MP4Read(path, flag) -> MP4Read(path)
 * MP4Close(handle) -> MP4Close(handle, flags)

Then detect this and add a new define to choose how to use functions.

12 years agorelease 0.4.4 with minor build improvements. release_0.4.4
Gustavo Sverzut Barbieri [Fri, 19 Aug 2011 21:00:48 +0000 (18:00 -0300)]
release 0.4.4 with minor build improvements.

12 years agoINSTALL: update autofoo provided install instructions file.
Gustavo Sverzut Barbieri [Fri, 19 Aug 2011 20:57:48 +0000 (17:57 -0300)]
INSTALL: update autofoo provided install instructions file.

12 years agoIgnore generated files.
Gustavo Sverzut Barbieri [Fri, 19 Aug 2011 20:57:03 +0000 (17:57 -0300)]
Ignore generated files.

12 years agoimprove autofoo handling of m4 and generation.
Gustavo Sverzut Barbieri [Fri, 19 Aug 2011 20:54:37 +0000 (17:54 -0300)]
improve autofoo handling of m4 and generation.

Use recommended macro in configure.ac and Makefile.am to define "m4/"
as our storage for macro files.

Use autoreconf instead of manually running all the commands on our
own.

12 years agoship config.rpath to shut up newer automake.
Gustavo Sverzut Barbieri [Fri, 19 Aug 2011 20:41:49 +0000 (17:41 -0300)]
ship config.rpath to shut up newer automake.

AM_ICONV requires config.rpath that is provided by gettext stuff, but
we don't use gettext/autopoint so it's not created. However seems
newer automake will complain about this missing file.

I'm not happy to copy this non-sense script into repository, but let's
go the easy route.

12 years agouse AM_ICONV to allow external libiconv to be used.
Gustavo Sverzut Barbieri [Thu, 18 Aug 2011 19:18:25 +0000 (16:18 -0300)]
use AM_ICONV to allow external libiconv to be used.

12 years agoUpdate my copyright and lgpl to 2.1
Gustavo Sverzut Barbieri [Wed, 17 Aug 2011 17:10:41 +0000 (14:10 -0300)]
Update my copyright and lgpl to 2.1

13 years agoFixed AM_CONDITIONAL(USE_TREMOR) if OGG was not in use. release_0.4.3
Gustavo Sverzut Barbieri [Tue, 22 Mar 2011 16:31:20 +0000 (13:31 -0300)]
Fixed AM_CONDITIONAL(USE_TREMOR) if OGG was not in use.

13 years ago0.4.2 release with RPM spec inside. release_0.4.2
Gustavo Sverzut Barbieri [Thu, 2 Dec 2010 01:13:26 +0000 (23:13 -0200)]
0.4.2 release with RPM spec inside.