* Replace sqlite_int64 with int64_t in many places, to better allow for the possibility of other databases. (Thanks Douglas Carmichael)

This commit is contained in:
Justin Maggard
2012-06-29 23:14:27 +00:00
parent 2c7a3bfc06
commit 61fbce18ba
19 changed files with 151 additions and 138 deletions

View File

@ -15,6 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@ -26,7 +28,6 @@
#include <sys/param.h>
#include <fcntl.h>
#include "config.h"
#include <libexif/exif-loader.h>
#include "image_utils.h"
#include "tagutils/tagutils.h"
@ -170,7 +171,7 @@ typedef AVMetadataTag AVDictionaryEntry;
#define MPEG_TS_PACKET_LENGTH 188
#define MPEG_TS_PACKET_LENGTH_DLNA 192 /* prepends 4 bytes to TS packet */
int
dlna_timestamp_is_present(const char * filename, int * raw_packet_size)
dlna_timestamp_is_present(const char *filename, int *raw_packet_size)
{
unsigned char buffer[3*MPEG_TS_PACKET_LENGTH_DLNA];
int fd, i;
@ -211,7 +212,7 @@ dlna_timestamp_is_present(const char * filename, int * raw_packet_size)
#ifdef TIVO_SUPPORT
int
is_tivo_file(const char * path)
is_tivo_file(const char *path)
{
unsigned char buf[5];
unsigned char hdr[5] = { 'T','i','V','o','\0' };
@ -230,7 +231,7 @@ is_tivo_file(const char * path)
#endif
void
check_for_captions(const char * path, sqlite_int64 detailID)
check_for_captions(const char *path, int64_t detailID)
{
char *file = malloc(MAXPATHLEN);
char *id = NULL;
@ -270,7 +271,7 @@ no_source_video:
}
void
parse_nfo(const char * path, metadata_t * m)
parse_nfo(const char *path, metadata_t *m)
{
FILE *nfo;
char buf[65536];
@ -321,7 +322,7 @@ parse_nfo(const char * path, metadata_t * m)
}
void
free_metadata(metadata_t * m, uint32_t flags)
free_metadata(metadata_t *m, uint32_t flags)
{
if( flags & FLAG_TITLE )
free(m->title);
@ -357,8 +358,8 @@ free_metadata(metadata_t * m, uint32_t flags)
free(m->rotation);
}
sqlite_int64
GetFolderMetadata(const char * name, const char * path, const char * artist, const char * genre, sqlite_int64 album_art)
int64_t
GetFolderMetadata(const char *name, const char *path, const char *artist, const char *genre, int64_t album_art)
{
int ret;
@ -375,16 +376,16 @@ GetFolderMetadata(const char * name, const char * path, const char * artist, con
return ret;
}
sqlite_int64
GetAudioMetadata(const char * path, char * name)
int64_t
GetAudioMetadata(const char *path, char *name)
{
char type[4];
static char lang[6] = { '\0' };
struct stat file;
sqlite_int64 ret;
int64_t ret;
char *esc_tag;
int i;
sqlite_int64 album_art = 0;
int64_t album_art = 0;
struct song_metadata song;
metadata_t m;
uint32_t free_flags = FLAG_MIME|FLAG_DURATION|FLAG_DLNA_PN|FLAG_DATE;
@ -580,8 +581,8 @@ libjpeg_error_handler(j_common_ptr cinfo)
return;
}
sqlite_int64
GetImageMetadata(const char * path, char * name)
int64_t
GetImageMetadata(const char *path, char *name)
{
ExifData *ed;
ExifEntry *e = NULL;
@ -593,8 +594,8 @@ GetImageMetadata(const char * path, char * name)
char make[32], model[64] = {'\0'};
char b[1024];
struct stat file;
sqlite_int64 ret;
image_s * imsrc;
int64_t ret;
image_s *imsrc;
metadata_t m;
uint32_t free_flags = 0xFFFFFFFF;
memset(&m, '\0', sizeof(metadata_t));
@ -752,8 +753,8 @@ no_exifdata:
return ret;
}
sqlite_int64
GetVideoMetadata(const char * path, char * name)
int64_t
GetVideoMetadata(const char *path, char *name)
{
struct stat file;
int ret, i;
@ -763,7 +764,7 @@ GetVideoMetadata(const char * path, char * name)
int audio_stream = -1, video_stream = -1;
enum audio_profiles audio_profile = PROFILE_AUDIO_UNKNOWN;
char fourcc[4];
sqlite_int64 album_art = 0;
int64_t album_art = 0;
char nfo[MAXPATHLEN], *ext;
struct song_metadata video;
metadata_t m;