#include "libavutil/opt.h"
#include <lightmediascanner_db.h>
+#include <lightmediascanner_dlna.h>
#include <lightmediascanner_plugin.h>
#include <sys/types.h>
LMS_STATIC_STRING_SIZE(".m3u"),
LMS_STATIC_STRING_SIZE(".mp4"),
LMS_STATIC_STRING_SIZE(".wma"),
+ LMS_STATIC_STRING_SIZE(".ogg"),
};
DECL_STR(_codec_mpeg1layer3, "mpeg1layer3");
DECL_STR(_container_3gp, "3gp");
DECL_STR(_container_mp4, "mp4");
+DECL_STR(_container_ogg, "ogg");
DECL_STR(_container_audio_wmav1, "wmav1");
DECL_STR(_container_audio_wmav2, "wmav2");
DECL_STR(_container_audio_wmavpro, "wmavpro");
+DECL_STR(_codec_video_theora, "theora");
+DECL_STR(_codec_audio_vorbis, "vorbis");
DECL_STR(_codec_audio_asf, "asf");
DECL_STR(_codec_audio_mpeg4aac_main, "mpeg4aac-main");
DECL_STR(_codec_audio_mpeg4aac_lc, "mpeg4aac-lc");
};
static const struct codec_container_descriptor _codec_list[] = {
- {CODEC_ID_MP3, &_codec_mpeg1layer3},
+ {AV_CODEC_ID_MP3, &_codec_mpeg1layer3},
{AV_CODEC_ID_WMAV1, &_codec_audio_asf},
{AV_CODEC_ID_WMAV2, &_codec_audio_asf},
{AV_CODEC_ID_WMAPRO, &_codec_audio_asf},
+ {AV_CODEC_ID_VORBIS, &_codec_audio_vorbis},
+ {AV_CODEC_ID_THEORA, &_codec_video_theora},
};
static const struct codec_container_descriptor _container_list[] = {
{AV_CODEC_ID_WMAV2, &_container_audio_wmav2},
{AV_CODEC_ID_WMAPRO, &_container_audio_wmavpro},
{AV_CODEC_ID_H264, &_container_mp4},
+ {AV_CODEC_ID_VORBIS, &_container_ogg},
+ {AV_CODEC_ID_THEORA, &_container_ogg},
};
static void
static const struct codec_container _codecs[] = {
{
- .id = CODEC_ID_MP3,
+ .id = AV_CODEC_ID_MP3,
.get_codec = _get_common_codec,
.get_container = NULL,
},
{
+ .id = AV_CODEC_ID_VORBIS,
+ .get_codec = _get_common_codec,
+ .get_container = _get_common_container,
+ },
+ {
+ .id = AV_CODEC_ID_THEORA,
+ .get_codec = _get_common_codec,
+ .get_container = _get_common_container,
+ },
+ {
.id = AV_CODEC_ID_AAC,
.get_codec = _mp4_get_audio_codec,
.get_container = _get_common_container,
s->video.width = ctx->width;
s->video.height = ctx->height;
- if (stream->r_frame_rate.den)
- s->video.framerate = stream->r_frame_rate.num / stream->r_frame_rate.den;
+ if (stream->avg_frame_rate.den)
+ s->video.framerate = stream->avg_frame_rate.num / stream->avg_frame_rate.den;
snprintf(aspect_ratio, sizeof(aspect_ratio), "%d:%d",
ctx->sample_aspect_ratio.num, ctx->sample_aspect_ratio.den);
struct lms_video_info video_info = { };
struct lms_string_size container = { };
bool video = false;
+ const struct lms_dlna_video_profile *video_dlna;
+ const struct lms_dlna_audio_profile *audio_dlna;
if (finfo->parsed)
return 0;
video_info.container = container;
video_info.packet_size = packet_size;
+ LMS_DLNA_GET_VIDEO_PROFILE_PATH_FB(&video_info, video_dlna,
+ finfo->path);
ret = lms_db_video_add(plugin->video_db, &video_info);
} else {
audio_info.id = finfo->id;
audio_info.genre = info.genre;
audio_info.container = container;
+ LMS_DLNA_GET_AUDIO_PROFILE_PATH_FB(&audio_info, audio_dlna,
+ finfo->path);
ret = lms_db_audio_add(plugin->audio_db, &audio_info);
+
lms_string_size_strip_and_free(&audio_info.codec);
}