Skip to content

Instantly share code, notes, and snippets.

View justinruggles's full-sized avatar

Justin Ruggles justinruggles

View GitHub Profile
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b992923..30c0192 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2486,6 +2486,10 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
// close codecs which were opened in try_decode_frame()
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
+ if (!has_codec_parameters(st)) {
+ av_log(ic, AV_LOG_WARNING,
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b992923..87052af 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2483,6 +2483,23 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
count++;
}
+ /* try to open decoders for all streams if not opened already */
+ for (i = 0; i < ic->nb_streams; i++) {
@justinruggles
justinruggles / gist:4262989
Created December 11, 2012 22:38
asyncts first_pts
From a0bfc6fd8e28d0d378c537f38ea48bbbd5aea96a Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Tue, 11 Dec 2012 17:36:09 -0500
Subject: [PATCH] WIP: fix the asyncts first_pts option
---
libavfilter/af_asyncts.c | 79 ++++++++++++++++++++++++++++++++++-----------
libavfilter/buffersrc.c | 7 ++++
2 files changed, 66 insertions(+), 20 deletions(-)
From 44696102f58adf000013b48e37a738b1a1d17b79 Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Tue, 11 Dec 2012 17:36:09 -0500
Subject: [PATCH] WIP: fix the asyncts first_pts option
---
libavfilter/af_asyncts.c | 79 +++++++++++++++++++++++++++++++++------------
1 files changed, 58 insertions(+), 21 deletions(-)
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
@justinruggles
justinruggles / gist:4741614
Created February 8, 2013 20:12
lavr: fix mixing matrix reduction when normalization is disabled
From c315796cd31782b98720faff17830bc1f9b76209 Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Sun, 27 Jan 2013 14:47:54 -0500
Subject: [PATCH] lavr: fix mixing matrix reduction when normalization is disabled
In some cases when an input contributes fully to the corresponding
output, other inputs may also contribute to the same output. This is the
case, for example, for the default 5.1 to stereo downmix matrix without
normalization.
---
if (avr->resample_needed) {
nb_samples = nb_samples * avr->out_sample_rate + avr->in_sample_rate / 2;
nb_samples /= avr->in_sample_rate;
}
@justinruggles
justinruggles / gist:5626a5ee51ab118b5692
Created July 18, 2014 21:41
[PATCH] lavr: Do not change the sample format for mono audio
From bbe80480e2a83895d4ba8626cad32e0004d73f1c Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Fri, 18 Jul 2014 17:39:01 -0400
Subject: [PATCH] lavr: Do not change the sample format for mono audio
This treats mono as planar internally within libavresample rather
than changing the sample format.
---
libavresample/audio_convert.c | 4 ++--
libavresample/audio_data.c | 12 ++++++++++--