New upstream version 0.16.2+dfsg1

This commit is contained in:
Sebastian Ramacher 2016-10-10 21:01:40 +02:00
parent 67704ac59c
commit 6efda2859e
377 changed files with 7938 additions and 696 deletions

View file

@ -76,7 +76,9 @@ static libvlc_media_t *get_media(struct darray *array, const char *path)
static inline libvlc_media_t *create_media_from_file(const char *file)
{
return libvlc_media_new_path_(libvlc, file);
return (file && strstr(file, "://") != NULL)
? libvlc_media_new_location_(libvlc, file)
: libvlc_media_new_path_(libvlc, file);
}
static void free_files(struct darray *array)
@ -299,11 +301,25 @@ static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
enum video_format new_format;
enum video_range_type range;
bool new_range;
unsigned new_width = 0;
unsigned new_height = 0;
size_t i = 0;
new_format = convert_vlc_video_format(chroma, &new_range);
libvlc_video_get_size_(c->media_player, 0, width, height);
/* This is used because VLC will by default try to use a different
* scaling than what the file uses (probably for optimization reasons).
* For example, if the file is 1920x1080, it will try to render it by
* 1920x1088, which isn't what we want. Calling libvlc_video_get_size
* gets the actual video file's size, and thus fixes the problem.
* However this doesn't work with URLs, so if it returns a 0 value, it
* shouldn't be used. */
libvlc_video_get_size_(c->media_player, 0, &new_width, &new_height);
if (new_width && new_height) {
*width = new_width;
*height = new_height;
}
/* don't allocate a new frame if format/width/height hasn't changed */
if (c->frame.format != new_format ||
@ -382,12 +398,14 @@ static void add_file(struct vlc_source *c, struct darray *array,
struct media_file_data data;
struct dstr new_path = {0};
libvlc_media_t *new_media;
bool is_url = path && strstr(path, "://") != NULL;
new_files.da = *array;
dstr_copy(&new_path, path);
#ifdef _WIN32
dstr_replace(&new_path, "/", "\\");
if (!is_url)
dstr_replace(&new_path, "/", "\\");
#endif
path = new_path.array;
@ -399,6 +417,10 @@ static void add_file(struct vlc_source *c, struct darray *array,
new_media = create_media_from_file(path);
if (new_media) {
if (is_url)
libvlc_media_add_option_(new_media,
":network-caching=100");
data.path = new_path.array;
data.media = new_media;
da_push_back(new_files, &data);