From 0ed170ec0b7483568ad82c936afee7803a533908 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 11:46:28 +0100 Subject: sub: fix memory leaks demux_lavf.c leaked the complete subtitle data if it was put through iconv. lavc_conv.c leaked AVCodecContext.subtitle_header (set by libavcodec), which is fixed by using avcodec_free_context(). It also leaked the subtitle that was decoded last. --- demux/demux_lavf.c | 2 ++ sub/lavc_conv.c | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 1b3105170d..8cd525b685 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -282,6 +282,8 @@ static void convert_charset(struct demuxer *demuxer) // libavformat transparently converts UTF-16 to UTF-8 if (!mp_charset_is_utf16(cp) && !mp_charset_is_utf8(cp)) { bstr conv = mp_iconv_to_utf8(demuxer->log, data, cp, MP_ICONV_VERBOSE); + if (conv.start && conv.start != data.start) + talloc_steal(alloc, conv.start); if (conv.start) data = conv; } diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index 42f9563391..f6c9b5abe2 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -78,7 +78,10 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name, if (!avctx) goto error; avctx->extradata_size = extradata_len; - avctx->extradata = talloc_memdup(priv, extradata, extradata_len); + avctx->extradata = av_malloc(extradata_len); + if (!avctx->extradata) + goto error; + memcpy(avctx->extradata, extradata, extradata_len); if (avcodec_open2(avctx, codec, NULL) < 0) goto error; // Documented as "set by libavcodec", but there is no other way @@ -264,7 +267,7 @@ void lavc_conv_reset(struct lavc_conv *priv) void lavc_conv_uninit(struct lavc_conv *priv) { - avcodec_close(priv->avctx); - av_free(priv->avctx); + avsubtitle_free(&priv->cur); + avcodec_free_context(&priv->avctx); talloc_free(priv); } -- cgit v1.2.3 From 418c98dec73c0a795ac123f9a3e6888ebda94aa7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 16:31:26 +0100 Subject: af_lavrresample: fudge some channel layout conversion Prevents channels from being dropped, e.g. when going 7.1 -> 7.1(wide) and similar cases. The reasoning here is that channel layouts over HDMI don't work anyway, and not dropping a channel and playing it on a slightly "wrong" (but expected) speaker is preferable to playing silence on these speakers. Do this to remove issues with ao_coreaudio. Frankly I'm not sure whether our mapping (between CA and mpv/FFmpeg speakers) is correct, but on the other hand due to the reasons stated above it's not all that meaningful. --- audio/filter/af_lavrresample.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c index f7f448cad0..477443cefc 100644 --- a/audio/filter/af_lavrresample.c +++ b/audio/filter/af_lavrresample.c @@ -179,6 +179,37 @@ bool af_lavrresample_test_conversion(int src_format, int dst_format) check_output_conversion(dst_format) != AV_SAMPLE_FMT_NONE; } +static struct mp_chmap fudge_pairs[][2] = { + {MP_CHMAP2(FLC, FRC), MP_CHMAP2(SL, SR)}, + {MP_CHMAP2(SL, SR), MP_CHMAP2(FLC, FRC)}, + {MP_CHMAP2(SDL, SDR), MP_CHMAP2(SL, SR)}, + {MP_CHMAP2(SL, SR), MP_CHMAP2(SDL, SDR)}, +}; + +// Modify out_layout and return the new value. The intention is reducing the +// loss libswresample's rematrixing will cause by exchanging similar, but +// strictly speaking incompatible channel pairs. For example, 7.1 should be +// changed to 7.1(wide) without dropping the SL/SR channels. (We still leave +// it to libswresample to create the remix matrix.) +static uint64_t fudge_layout_conversion(struct af_instance *af, + uint64_t in, uint64_t out) +{ + for (int n = 0; n < MP_ARRAY_SIZE(fudge_pairs); n++) { + uint64_t a = mp_chmap_to_lavc(&fudge_pairs[n][0]); + uint64_t b = mp_chmap_to_lavc(&fudge_pairs[n][1]); + if ((in & a) == a && (in & b) == 0 && + (out & a) == 0 && (out & b) == b) + { + out = (out & ~b) | a; + + MP_VERBOSE(af, "Fudge: %s -> %s\n", + mp_chmap_to_str(&fudge_pairs[n][0]), + mp_chmap_to_str(&fudge_pairs[n][1])); + } + } + return out; +} + // mp_chmap_get_reorder() performs: // to->speaker[n] = from->speaker[src[n]] // but libavresample does: @@ -297,6 +328,8 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in, if (map_out.num > out_lavc.num) mp_audio_set_channels(&s->pool_fmt, &map_out); + out_ch_layout = fudge_layout_conversion(af, in_ch_layout, out_ch_layout); + // Real conversion; output is input to avrctx_out. av_opt_set_int(s->avrctx, "in_channel_layout", in_ch_layout, 0); av_opt_set_int(s->avrctx, "out_channel_layout", out_ch_layout, 0); -- cgit v1.2.3 From dfe630c5d185d196539bfee7eda569c139576767 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 16:36:06 +0100 Subject: manpage: adjust --display-fps description Make it more conservative. In most cases, mpv should be able to determine it correctly on all supported platforms. --- DOCS/man/options.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index e5fe542712..ac235d4fc4 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -560,9 +560,13 @@ Video ``--display-fps=`` Set the display FPS used with the ``--video-sync=display-*`` modes. By - default, a detected value is used (X11 only, not correct on multi-monitor - systems). Keep in mind that setting an incorrect value (even if slightly - incorrect) can ruin video playback. + default, a detected value is used. Keep in mind that setting an incorrect + value (even if slightly incorrect) can ruin video playback. On multi-monitor + systems, there is a chance that the detected value is from the wrong + monitor. + + Set this option only if you have reason to believe the automatically + determined value is wrong. ``--hwdec=`` Specify the hardware video decoding API that should be used if possible. -- cgit v1.2.3 From 2bbed8013563e07e3fb5468c41f4d014b33fb887 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 17:42:34 +0100 Subject: demux: remove unused flag --- demux/demux.h | 1 - player/loadfile.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/demux/demux.h b/demux/demux.h index d274be5ae7..7a24230cc8 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -160,7 +160,6 @@ struct demuxer_params { struct matroska_segment_uid *matroska_wanted_uids; int matroska_wanted_segment; bool *matroska_was_valid; - bool expect_subtitle; // -- demux_open_url() only int stream_flags; bool allow_capture; diff --git a/player/loadfile.c b/player/loadfile.c index aecdbf46de..7a33fd7478 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -693,9 +693,7 @@ struct track *mp_add_external_file(struct MPContext *mpctx, char *filename, if (strncmp(disp_filename, "memory://", 9) == 0) disp_filename = "memory://"; // avoid noise - struct demuxer_params params = { - .expect_subtitle = filter == STREAM_SUB, - }; + struct demuxer_params params = {0}; switch (filter) { case STREAM_SUB: -- cgit v1.2.3 From 6f35d4df5afdd01c9f95cea573ba8b7bf7e89d0a Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 17:50:12 +0100 Subject: cache: add mechanism for disabling readahead Will be used in a following commit. --- stream/cache.c | 17 ++++++++++++++++- stream/stream.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/stream/cache.c b/stream/cache.c index ff5dd9fca6..8c18d18b1a 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -96,7 +96,10 @@ struct priv { bool idle; // cache thread has stopped reading int64_t reads; // number of actual read attempts performed + bool enable_readahead; // actively read beyond read() position int64_t read_filepos; // client read position (mirrors cache->pos) + int64_t read_min; // file position until which the thread should + // read even if readahead is disabled int64_t eof_pos; @@ -208,6 +211,11 @@ static void cache_fill(struct priv *s) goto done; } + if (!s->enable_readahead && s->read_min <= s->max_filepos) { + s->idle = true; + return; + } + if (mp_cancel_test(s->cache->cancel)) goto done; @@ -372,6 +380,10 @@ static int cache_get_cached_control(stream_t *cache, int cmd, void *arg) case STREAM_CTRL_GET_CACHE_IDLE: *(int *)arg = s->idle; return STREAM_OK; + case STREAM_CTRL_SET_READAHEAD: + s->enable_readahead = *(int *)arg; + pthread_cond_signal(&s->wakeup); + return STREAM_OK; case STREAM_CTRL_GET_TIME_LENGTH: *(double *)arg = s->stream_time_length; return s->stream_time_length ? STREAM_OK : STREAM_UNSUPPORTED; @@ -447,6 +459,7 @@ static void cache_execute_control(struct priv *s) } else if (pos_changed || (ok && control_needs_flush(s->control))) { MP_VERBOSE(s, "Dropping cache due to control()\n"); s->read_filepos = stream_tell(s->stream); + s->read_min = s->read_filepos; s->control_flush = true; cache_drop_contents(s); } @@ -503,6 +516,7 @@ static int cache_fill_buffer(struct stream *cache, char *buffer, int max_len) double retry_time = 0; int64_t retry = s->reads - 1; // try at least 1 read on EOF while (1) { + s->read_min = s->read_filepos + max_len + 64 * 1024; readb = read_buffer(s, buffer, max_len, s->read_filepos); s->read_filepos += readb; if (readb > 0) @@ -541,7 +555,7 @@ static int cache_seek(stream_t *cache, int64_t pos) MP_ERR(s, "Attempting to seek before cached data in unseekable stream.\n"); r = 0; } else { - cache->pos = s->read_filepos = pos; + cache->pos = s->read_filepos = s->read_min = pos; s->eof = false; // so that cache_read() will actually wait for new data pthread_cond_signal(&s->wakeup); } @@ -616,6 +630,7 @@ int stream_cache_init(stream_t *cache, stream_t *stream, struct priv *s = talloc_zero(NULL, struct priv); s->log = cache->log; s->eof_pos = -1; + s->enable_readahead = true; cache_drop_contents(s); diff --git a/stream/stream.h b/stream/stream.h index 11e70bcb7d..ab37c3b4bd 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -72,6 +72,7 @@ enum stream_ctrl { STREAM_CTRL_GET_CACHE_FILL, STREAM_CTRL_GET_CACHE_IDLE, STREAM_CTRL_RESUME_CACHE, + STREAM_CTRL_SET_READAHEAD, // stream_memory.c STREAM_CTRL_SET_CONTENTS, -- cgit v1.2.3 From 488f569d9956d12e8ac5db79cf5959f015b4f8d0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 18:21:29 +0100 Subject: demux: unify codepaths for threaded/unthreaded track switching Well, not that the unthreaded case is important, or even works properly. --- demux/demux.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index 19ad6970b0..4fedc69e60 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1273,19 +1273,21 @@ void demuxer_select_track(struct demuxer *demuxer, struct sh_stream *stream, { struct demux_internal *in = demuxer->in; pthread_mutex_lock(&in->lock); - bool update = false; // don't flush buffers if stream is already selected / unselected if (stream->ds->selected != selected) { stream->ds->selected = selected; stream->ds->active = false; ds_flush(stream->ds); - if (selected && in->refresh_seeks_enabled && in->threading) - in->start_refresh_seek = true; - update = true; + in->tracks_switched = true; + if (in->threading) { + if (selected && in->refresh_seeks_enabled) + in->start_refresh_seek = true; + pthread_cond_signal(&in->wakeup); + } else { + execute_trackswitch(in); + } } pthread_mutex_unlock(&in->lock); - if (update) - demux_control(demuxer, DEMUXER_CTRL_SWITCHED_TRACKS, NULL); } void demux_set_stream_autoselect(struct demuxer *demuxer, bool autoselect) @@ -1456,10 +1458,6 @@ static int cached_demux_control(struct demux_internal *in, int cmd, void *arg) c->res = r; return DEMUXER_CTRL_OK; } - case DEMUXER_CTRL_SWITCHED_TRACKS: - in->tracks_switched = true; - pthread_cond_signal(&in->wakeup); - return DEMUXER_CTRL_OK; case DEMUXER_CTRL_GET_BITRATE_STATS: { double *rates = arg; for (int n = 0; n < STREAM_TYPE_COUNT; n++) -- cgit v1.2.3 From f15a79d14467d8c30dcaffa53d8871ef01b9328e Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 18:25:14 +0100 Subject: demux: fix interleaved subtitle reading in unthreaded mode Meh. Why are there even two code paths. This adds an additional check; the big function is only moved. --- demux/demux.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index 4fedc69e60..de59a6dc28 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -667,6 +667,21 @@ static struct demux_packet *dequeue_packet(struct demux_stream *ds) return pkt; } +// Sparse packets (Subtitles) interleaved with other non-sparse packets (video, +// audio) should never be read actively, meaning the demuxer thread does not +// try to exceed default readahead in order to find a new packet. +static bool use_lazy_subtitle_reading(struct demux_stream *ds) +{ + if (ds->type != STREAM_SUB) + return false; + for (int n = 0; n < ds->in->num_streams; n++) { + struct demux_stream *s = ds->in->streams[n]->ds; + if (s->type != STREAM_SUB && s->selected && !s->eof) + return true; + } + return false; +} + // Read a packet from the given stream. The returned packet belongs to the // caller, who has to free it with talloc_free(). Might block. Returns NULL // on EOF. @@ -676,7 +691,8 @@ struct demux_packet *demux_read_packet(struct sh_stream *sh) struct demux_packet *pkt = NULL; if (ds) { pthread_mutex_lock(&ds->in->lock); - ds_get_packets(ds); + if (!use_lazy_subtitle_reading(ds)) + ds_get_packets(ds); pkt = dequeue_packet(ds); pthread_cond_signal(&ds->in->wakeup); // possibly read more pthread_mutex_unlock(&ds->in->lock); @@ -684,21 +700,6 @@ struct demux_packet *demux_read_packet(struct sh_stream *sh) return pkt; } -// Sparse packets (Subtitles) interleaved with other non-sparse packets (video, -// audio) should never be read actively, meaning the demuxer thread does not -// try to exceed default readahead in order to find a new packet. -static bool use_lazy_subtitle_reading(struct demux_stream *ds) -{ - if (ds->type != STREAM_SUB) - return false; - for (int n = 0; n < ds->in->num_streams; n++) { - struct demux_stream *s = ds->in->streams[n]->ds; - if (s->type != STREAM_SUB && s->selected && !s->eof) - return true; - } - return false; -} - // Poll the demuxer queue, and if there's a packet, return it. Otherwise, just // make the demuxer thread read packets for this stream, and if there's at // least one packet, call the wakeup callback. -- cgit v1.2.3 From 5986861c9cbe33509b9a18ad048bbc0de7ba8dbe Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 18:26:14 +0100 Subject: demux: remove unused function --- demux/demux.c | 13 ------------- demux/demux.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index de59a6dc28..1991ad216b 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1256,19 +1256,6 @@ struct sh_stream *demuxer_stream_by_demuxer_id(struct demuxer *d, return NULL; } -void demuxer_switch_track(struct demuxer *demuxer, enum stream_type type, - struct sh_stream *stream) -{ - assert(!stream || stream->type == type); - - int num = demux_get_num_stream(demuxer); - for (int n = 0; n < num; n++) { - struct sh_stream *cur = demux_get_stream(demuxer, n); - if (cur->type == type) - demuxer_select_track(demuxer, cur, cur == stream); - } -} - void demuxer_select_track(struct demuxer *demuxer, struct sh_stream *stream, bool selected) { diff --git a/demux/demux.h b/demux/demux.h index 7a24230cc8..33cbe0f3b1 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -272,8 +272,6 @@ void demux_set_ts_offset(struct demuxer *demuxer, double offset); int demux_control(struct demuxer *demuxer, int cmd, void *arg); -void demuxer_switch_track(struct demuxer *demuxer, enum stream_type type, - struct sh_stream *stream); void demuxer_select_track(struct demuxer *demuxer, struct sh_stream *stream, bool selected); void demux_set_stream_autoselect(struct demuxer *demuxer, bool autoselect); -- cgit v1.2.3 From 46bcdb7039cdf146966075f268c68b0fcee5ebbf Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 18:34:44 +0100 Subject: demux: disable stream cache if no tracks are selected Slightly helps with timeline stuff, like EDL. There is no need to keep network (or even just disk I/O) busy for all segments at the same time, because 1. the data won't be needed any time soon, and 2. will probably be discarded anyway if the stream is seeked when segment is resumed. Partially fixes #2692. --- demux/demux.c | 8 ++++++++ player/loadfile.c | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/demux/demux.c b/demux/demux.c index 1991ad216b..e286bf0e32 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -558,11 +558,18 @@ static void execute_trackswitch(struct demux_internal *in) { in->tracks_switched = false; + bool any_selected = false; + for (int n = 0; n < in->num_streams; n++) + any_selected |= in->streams[n]->ds->selected; + pthread_mutex_unlock(&in->lock); if (in->d_thread->desc->control) in->d_thread->desc->control(in->d_thread, DEMUXER_CTRL_SWITCHED_TRACKS, 0); + stream_control(in->d_thread->stream, STREAM_CTRL_SET_READAHEAD, + &(int){any_selected}); + pthread_mutex_lock(&in->lock); if (in->start_refresh_seek) @@ -1077,6 +1084,7 @@ static struct demuxer *open_given_type(struct mpv_global *global, demux_init_cache(demuxer); demux_changed(in->d_thread, DEMUX_EVENT_ALL); demux_update(demuxer); + stream_control(demuxer->stream, STREAM_CTRL_SET_READAHEAD, &(int){false}); return demuxer; } diff --git a/player/loadfile.c b/player/loadfile.c index 7a33fd7478..7d5a5f847d 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -312,7 +312,10 @@ bool timeline_switch_to_time(struct MPContext *mpctx, double pts) if (mpctx->demuxer) { demux_stop_thread(mpctx->demuxer); - demux_flush(mpctx->demuxer); + for (int i = 0; i < demux_get_num_stream(mpctx->demuxer); i++) { + struct sh_stream *sh = demux_get_stream(mpctx->demuxer, i); + demuxer_select_track(mpctx->demuxer, sh, false); + } } mpctx->demuxer = n->source; -- cgit v1.2.3 From 5053f4cc3f48538c3d9a3ba13dc98442f3302052 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Jan 2016 20:10:28 +0100 Subject: command: fix NULL pointer deref in "video-codec" property Fixes #2729. --- player/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/command.c b/player/command.c index 3c7cfb282d..413349dce3 100644 --- a/player/command.c +++ b/player/command.c @@ -2438,7 +2438,7 @@ static int mp_property_video_codec(void *ctx, struct m_property *prop, { MPContext *mpctx = ctx; struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - const char *c = track->d_video ? track->d_video->decoder_desc : NULL; + const char *c = track && track->d_video ? track->d_video->decoder_desc : NULL; return m_property_strdup_ro(action, arg, c); } -- cgit v1.2.3 From 1781bf26f101442be06d72243e8cbeffcaa47658 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Thu, 7 Jan 2016 13:31:09 -0800 Subject: ass_mp: add mp_ass_flush_old_events() --- sub/ass_mp.c | 14 ++++++++++++++ sub/ass_mp.h | 1 + 2 files changed, 15 insertions(+) diff --git a/sub/ass_mp.c b/sub/ass_mp.c index b30b9964de..8d40b5256a 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -163,3 +163,17 @@ ASS_Library *mp_ass_init(struct mpv_global *global, struct mp_log *log) talloc_free(path); return priv; } + +void mp_ass_flush_old_events(ASS_Track *track, long long ts) +{ + int n = 0; + for (; n < track->n_events; n++) { + if ((track->events[n].Start + track->events[n].Duration) >= ts) + break; + ass_free_event(track, n); + track->n_events--; + } + for (int i = 0; n > 0 && i < track->n_events; i++) { + track->events[i] = track->events[i+n]; + } +} diff --git a/sub/ass_mp.h b/sub/ass_mp.h index 98311824ab..789a53acb1 100644 --- a/sub/ass_mp.h +++ b/sub/ass_mp.h @@ -44,6 +44,7 @@ struct mpv_global; struct mp_osd_res; struct osd_style_opts; +void mp_ass_flush_old_events(ASS_Track *track, long long ts); void mp_ass_set_style(ASS_Style *style, double res_y, const struct osd_style_opts *opts); -- cgit v1.2.3 From ed3e5330ec1f201895c90f73a0c099a75241b404 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 18 Jan 2016 12:13:42 -0800 Subject: lavc_conv: pass real_time=1 option to ffmpeg for eia_608 decoder --- sub/lavc_conv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index f6c9b5abe2..b822f52bf3 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "config.h" @@ -70,6 +71,7 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name, priv->cur_list = talloc_array(priv, char*, 0); priv->codec = talloc_strdup(priv, codec_name); AVCodecContext *avctx = NULL; + AVDictionary *opts = NULL; const char *fmt = get_lavc_format(priv->codec); AVCodec *codec = avcodec_find_decoder(mp_codec_to_av_codec_id(fmt)); if (!codec) @@ -82,8 +84,11 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name, if (!avctx->extradata) goto error; memcpy(avctx->extradata, extradata, extradata_len); - if (avcodec_open2(avctx, codec, NULL) < 0) + if (strcmp(codec_name, "eia_608") == 0) + av_dict_set(&opts, "real_time", "1", 0); + if (avcodec_open2(avctx, codec, &opts) < 0) goto error; + av_dict_free(&opts); // Documented as "set by libavcodec", but there is no other way avctx->time_base = (AVRational) {1, 1000}; priv->avctx = avctx; @@ -94,6 +99,7 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name, error: MP_FATAL(priv, "Could not open libavcodec subtitle converter\n"); + av_dict_free(&opts); av_free(avctx); talloc_free(priv); return NULL; -- cgit v1.2.3 From f9cefbfec4d7bfec44991d4372aad4fc1b3167a5 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 21 Dec 2015 17:35:15 -0800 Subject: vd_lavc: feed A53_CC side data packets into the demuxer for eia_608 decoding --- demux/demux.c | 25 +++++++++++++++++++++++++ demux/demux.h | 1 + sub/sd_ass.c | 18 ++++++++++++++++-- video/decode/vd_lavc.c | 11 +++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index e286bf0e32..af0a93c03d 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -160,6 +160,10 @@ struct demux_stream { int64_t last_pos; struct demux_packet *head; struct demux_packet *tail; + + // for closed captions (demuxer_feed_caption) + struct sh_stream *cc; + }; // Return "a", or if that is NOPTS, return "def". @@ -361,6 +365,27 @@ const char *stream_type_name(enum stream_type type) } } +void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp) +{ + struct demuxer *demuxer = stream->ds->in->d_thread; + struct sh_stream *sh = stream->ds->cc; + + if (!sh) { + sh = demux_alloc_sh_stream(STREAM_SUB); + if (!sh) + return; + sh->codec->codec = "eia_608"; + stream->ds->cc = sh; + demux_add_sh_stream(demuxer, sh); + } + + if (demux_stream_is_selected(sh)) { + dp->pts = MP_ADD_PTS(dp->pts, -stream->ds->in->ts_offset); + dp->dts = MP_ADD_PTS(dp->dts, -stream->ds->in->ts_offset); + demux_add_packet(sh, dp); + } +} + void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp) { struct demux_stream *ds = stream ? stream->ds : NULL; diff --git a/demux/demux.h b/demux/demux.h index 33cbe0f3b1..72ed15888b 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -237,6 +237,7 @@ void free_demuxer(struct demuxer *demuxer); void free_demuxer_and_stream(struct demuxer *demuxer); void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp); +void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp); struct demux_packet *demux_read_packet(struct sh_stream *sh); int demux_read_packet_async(struct sh_stream *sh, struct demux_packet **out_pkt); diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 2358ba45f6..5c56d3e0df 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -51,6 +51,7 @@ struct sd_ass_priv { double sub_speed, video_fps, frame_fps; int64_t *seen_packets; int num_seen_packets; + bool duration_unknown; }; static void mangle_colors(struct sd *sd, struct sub_bitmaps *parts); @@ -176,6 +177,9 @@ static int init(struct sd *sd) return -1; extradata = lavc_conv_get_extradata(ctx->converter); extradata_size = extradata ? strlen(extradata) : 0; + + if (strcmp(sd->codec->codec, "eia_608") == 0) + ctx->duration_unknown = 1; } ctx->ass_library = mp_ass_init(sd->global, sd->log); @@ -239,11 +243,18 @@ static void decode(struct sd *sd, struct demux_packet *packet) struct sd_ass_priv *ctx = sd->priv; ASS_Track *track = ctx->ass_track; if (ctx->converter) { - if (!sd->opts->sub_clear_on_seek && check_packet_seen(sd, packet->pos)) + if (!sd->opts->sub_clear_on_seek && packet->pos >= 0 && + check_packet_seen(sd, packet->pos)) return; char **r = lavc_conv_decode(ctx->converter, packet); for (int n = 0; r && r[n]; n++) ass_process_data(track, r[n], strlen(r[n])); + if (ctx->duration_unknown) { + for (int n = 0; n < track->n_events - 1; n++) { + track->events[n].Duration = track->events[n + 1].Start - + track->events[n].Start; + } + } } else { // Note that for this packet format, libass has an internal mechanism // for discarding duplicate (already seen) packets. @@ -426,9 +437,12 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts, } else { ass_set_storage_size(renderer, 0, 0); } + long long ts = find_timestamp(sd, pts); + if (ctx->duration_unknown && pts != MP_NOPTS_VALUE) { + mp_ass_flush_old_events(track, ts); + } if (no_ass) fill_plaintext(sd, pts); - long long ts = find_timestamp(sd, pts); mp_ass_render_frame(renderer, track, ts, &ctx->parts, res); talloc_steal(ctx, ctx->parts); diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index f47e72a1cd..9677e4c079 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -41,6 +41,7 @@ #include "video/img_format.h" #include "video/filter/vf.h" #include "video/decode/dec_video.h" +#include "demux/demux.h" #include "demux/stheader.h" #include "demux/packet.h" #include "video/csputils.h" @@ -680,6 +681,16 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL); vd->codec_dts = mp_pts_from_av(ctx->pic->pkt_dts, NULL); + AVFrameSideData *sd = NULL; + sd = av_frame_get_side_data(ctx->pic, AV_FRAME_DATA_A53_CC); + if (sd) { + struct demux_packet *cc = new_demux_packet_from(sd->data, sd->size); + cc->pts = vd->codec_pts; + cc->dts = vd->codec_dts; + cc->pos = -1; + demuxer_feed_caption(vd->header, cc); + } + struct mp_image *mpi = mp_image_from_av_frame(ctx->pic); av_frame_unref(ctx->pic); if (!mpi) -- cgit v1.2.3 From 48c9101a5b18b5c57e700dc48615fbdfa843803f Mon Sep 17 00:00:00 2001 From: rr- Date: Mon, 18 Jan 2016 22:33:52 +0100 Subject: vo_drm: fix CRTC usage --- video/out/drm_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/drm_common.c b/video/out/drm_common.c index d3a05f56b0..eff19c1f31 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -128,7 +128,7 @@ static bool setup_crtc(struct kms *kms, const drmModeRes *res) continue; kms->encoder = encoder; - kms->crtc_id = encoder->crtc_id; + kms->crtc_id = res->crtcs[j]; return true; } -- cgit v1.2.3 From cd5eb1bb199253747800483203976200e7775617 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Fri, 15 Jan 2016 18:29:06 -0800 Subject: ao_openal: wipe out global context on init error Previously this would break all further attempts to init the driver after one had failed. --- audio/out/ao_openal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c index c6c924b244..72e8799e00 100644 --- a/audio/out/ao_openal.c +++ b/audio/out/ao_openal.c @@ -236,6 +236,7 @@ static int init(struct ao *ao) return 0; err_out: + ao_data = NULL; return -1; } -- cgit v1.2.3 From a99b63db08306b34ef53f5a18807c811b64491a7 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Tue, 5 Jan 2016 18:40:35 -0800 Subject: ao_wasapi: use share_mode value instead of raw option opt_exclusive Previously used opt_exclusive option to decide which volume control code to run. The might not always reflect the actual state, for example if passthrough is used. Admittedly, none of the volume controls will work anyway with passthrough, but this is the right thing to do. --- audio/out/ao_wasapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index 1c0e85b7bb..f56c853627 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -441,7 +441,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) return CONTROL_OK; } - return state->opt_exclusive ? + return state->share_mode == AUDCLNT_SHAREMODE_EXCLUSIVE ? control_exclusive(ao, cmd, arg) : control_shared(ao, cmd, arg); } -- cgit v1.2.3 From ae4b0f3f7ce31e1f9f5ea51422cd21c900179d52 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Jan 2016 14:19:50 +0100 Subject: demux: fix leaking closed captions packets with unselected sub stream Calling demux_add_packet() unconditonally frees the packet if the stream is not selected. --- demux/demux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index af0a93c03d..d0a37b9d83 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -372,18 +372,18 @@ void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp) if (!sh) { sh = demux_alloc_sh_stream(STREAM_SUB); - if (!sh) + if (!sh) { + talloc_free(dp); return; + } sh->codec->codec = "eia_608"; stream->ds->cc = sh; demux_add_sh_stream(demuxer, sh); } - if (demux_stream_is_selected(sh)) { - dp->pts = MP_ADD_PTS(dp->pts, -stream->ds->in->ts_offset); - dp->dts = MP_ADD_PTS(dp->dts, -stream->ds->in->ts_offset); - demux_add_packet(sh, dp); - } + dp->pts = MP_ADD_PTS(dp->pts, -stream->ds->in->ts_offset); + dp->dts = MP_ADD_PTS(dp->dts, -stream->ds->in->ts_offset); + demux_add_packet(sh, dp); } void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp) -- cgit v1.2.3 From 6fafdd51428dced8553f8545ce1a88fe88614b2a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Jan 2016 14:21:02 +0100 Subject: demux: remove a minor difference between threaded/unthreaded modes This difference was unnecessary. --- demux/demux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index d0a37b9d83..c00f5bf3c8 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1300,9 +1300,9 @@ void demuxer_select_track(struct demuxer *demuxer, struct sh_stream *stream, stream->ds->active = false; ds_flush(stream->ds); in->tracks_switched = true; + if (selected && in->refresh_seeks_enabled) + in->start_refresh_seek = true; if (in->threading) { - if (selected && in->refresh_seeks_enabled) - in->start_refresh_seek = true; pthread_cond_signal(&in->wakeup); } else { execute_trackswitch(in); -- cgit v1.2.3 From 8a9b64329c0e387dc59a1fca477a43c50f59ff34 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Jan 2016 18:36:06 +0100 Subject: Relicense some non-MPlayer source files to LGPL 2.1 or later This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone. --- audio/audio_buffer.c | 14 +++++++------- audio/audio_buffer.h | 14 +++++++------- audio/chmap.c | 14 +++++++------- audio/chmap.h | 14 +++++++------- audio/chmap_sel.c | 14 +++++++------- audio/chmap_sel.h | 14 +++++++------- audio/filter/af_lavfi.c | 14 +++++++------- audio/filter/af_rubberband.c | 14 +++++++------- audio/out/ao_sdl.c | 14 +++++++------- audio/out/ao_wasapi.c | 14 +++++++------- audio/out/ao_wasapi.h | 14 +++++++------- audio/out/ao_wasapi_changenotify.c | 14 +++++++------- audio/out/ao_wasapi_utils.c | 14 +++++++------- audio/out/pull.c | 14 +++++++------- audio/out/push.c | 14 +++++++------- common/av_common.c | 14 +++++++------- common/av_common.h | 14 +++++++------- common/codecs.c | 14 +++++++------- common/codecs.h | 14 +++++++------- common/common.c | 14 +++++++------- common/playlist.c | 14 +++++++------- common/playlist.h | 14 +++++++------- common/tags.c | 14 +++++++------- common/version.c | 14 +++++++------- demux/codec_tags.c | 14 +++++++------- demux/codec_tags.h | 14 +++++++------- demux/cue.c | 14 +++++++------- demux/cue.h | 14 +++++++------- demux/demux_cue.c | 14 +++++++------- demux/demux_disc.c | 14 +++++++------- demux/demux_edl.c | 14 +++++++------- demux/demux_mkv_timeline.c | 14 +++++++------- demux/demux_playlist.c | 32 +++++++------------------------- demux/demux_rar.c | 14 +++++++------- input/event.c | 14 +++++++------- input/event.h | 14 +++++++------- misc/charset_conv.c | 14 +++++++------- misc/dispatch.c | 14 +++++++------- misc/json.c | 14 +++++++------- misc/json.h | 14 +++++++------- misc/ring.c | 14 +++++++------- misc/ring.h | 14 +++++++------- osdep/atomics.h | 14 +++++++------- osdep/io.c | 14 +++++++------- osdep/io.h | 14 +++++++------- osdep/path-macosx.m | 14 +++++++------- osdep/path-unix.c | 14 +++++++------- osdep/path-win.c | 14 +++++++------- osdep/subprocess-posix.c | 14 +++++++------- osdep/subprocess-win.c | 14 +++++++------- osdep/subprocess.c | 14 +++++++------- osdep/subprocess.h | 14 +++++++------- osdep/threads.c | 15 ++++++++------- osdep/timer.c | 14 +++++++------- player/core.h | 2 +- player/lua.c | 14 +++++++------- player/misc.c | 22 +++++++--------------- player/playloop.c | 8 ++++++++ player/screenshot.c | 14 +++++++------- player/screenshot.h | 14 +++++++------- player/scripting.c | 14 +++++++------- stream/cache_file.c | 15 ++++++++------- stream/stream_avdevice.c | 14 +++++++------- stream/stream_memory.c | 14 +++++++------- sub/dec_sub.c | 14 +++++++------- sub/draw_bmp.c | 14 +++++++------- sub/img_convert.c | 14 +++++++------- sub/lavc_conv.c | 14 +++++++------- sub/osd_libass.c | 14 +++++++------- video/decode/rpi.c | 14 +++++++------- video/decode/vdpau.c | 14 +++++++------- video/filter/vf_dlopen.c | 14 +++++++------- video/filter/vf_lavfi.c | 14 +++++++------- video/filter/vf_vdpaurb.c | 14 +++++++------- video/mp_image_pool.c | 14 +++++++------- video/out/bitmap_packer.c | 14 +++++++------- video/out/drm_common.h | 14 +++++++------- video/out/opengl/context_wayland.c | 14 +++++++------- video/out/vo_rpi.c | 14 +++++++------- video/out/vo_sdl.c | 14 +++++++------- video/out/vo_wayland.c | 14 +++++++------- video/out/wayland/buffer.c | 14 +++++++------- video/out/wayland/buffer.h | 14 +++++++------- video/out/wayland/memfile.c | 14 +++++++------- video/out/wayland/memfile.h | 14 +++++++------- video/out/wayland_common.c | 14 +++++++------- video/out/wayland_common.h | 14 +++++++------- video/sws_utils.c | 14 +++++++------- 88 files changed, 613 insertions(+), 629 deletions(-) diff --git a/audio/audio_buffer.c b/audio/audio_buffer.c index c0f1341afe..a443a2185a 100644 --- a/audio/audio_buffer.c +++ b/audio/audio_buffer.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/audio_buffer.h b/audio/audio_buffer.h index f517542ef5..212d187572 100644 --- a/audio/audio_buffer.h +++ b/audio/audio_buffer.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #ifndef MP_AUDIO_BUFFER_H diff --git a/audio/chmap.c b/audio/chmap.c index e0f485c4dc..1d4970da6c 100644 --- a/audio/chmap.c +++ b/audio/chmap.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/chmap.h b/audio/chmap.h index b32c63b6fc..aa9b1c5a10 100644 --- a/audio/chmap.h +++ b/audio/chmap.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #ifndef MP_CHMAP_H diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c index fa1941e6f6..45b696c924 100644 --- a/audio/chmap_sel.c +++ b/audio/chmap_sel.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/chmap_sel.h b/audio/chmap_sel.h index 12ded3b466..5bd8783b83 100644 --- a/audio/chmap_sel.h +++ b/audio/chmap_sel.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #ifndef MP_CHMAP_SEL_H diff --git a/audio/filter/af_lavfi.c b/audio/filter/af_lavfi.c index af521abd9c..1960ddc247 100644 --- a/audio/filter/af_lavfi.c +++ b/audio/filter/af_lavfi.c @@ -3,18 +3,18 @@ * * Filter graph creation code taken from FFmpeg ffplay.c (LGPL 2.1 or later) * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/filter/af_rubberband.c b/audio/filter/af_rubberband.c index 2619e4b210..48bb510679 100644 --- a/audio/filter/af_rubberband.c +++ b/audio/filter/af_rubberband.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c index 5e5bd25b96..627a1098cf 100644 --- a/audio/out/ao_sdl.c +++ b/audio/out/ao_sdl.c @@ -4,18 +4,18 @@ * * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include "config.h" diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index f56c853627..5c30f7394a 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -3,18 +3,18 @@ * * Original author: Jonathan Yong <10walls@gmail.com> * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index 5ba2aa325c..642d92f66f 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -3,18 +3,18 @@ * * Original author: Jonathan Yong <10walls@gmail.com> * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #ifndef MP_AO_WASAPI_H_ diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c index c2bce0d42b..c25b806c8e 100644 --- a/audio/out/ao_wasapi_changenotify.c +++ b/audio/out/ao_wasapi_changenotify.c @@ -3,18 +3,18 @@ * * Original author: Jonathan Yong <10walls@gmail.com> * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index d29c6bed7d..c5e1eab455 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -3,18 +3,18 @@ * * Original author: Jonathan Yong <10walls@gmail.com> * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/out/pull.c b/audio/out/pull.c index 1484c5195f..89805809b7 100644 --- a/audio/out/pull.c +++ b/audio/out/pull.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/audio/out/push.c b/audio/out/push.c index 301004bd99..4fa2bc53d5 100644 --- a/audio/out/push.c +++ b/audio/out/push.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/common/av_common.c b/common/av_common.c index c1b188474a..8b979cabba 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/common/av_common.h b/common/av_common.h index 0b0260982f..e9df328fbf 100644 --- a/common/av_common.h +++ b/common/av_common.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #ifndef MP_AVCOMMON_H diff --git a/common/codecs.c b/common/codecs.c index da0bd69db4..c0d99eb959 100644 --- a/common/codecs.c +++ b/common/codecs.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #include diff --git a/common/codecs.h b/common/codecs.h index a262ed6582..17316c85e9 100644 --- a/common/codecs.h +++ b/common/codecs.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public Lic