On Mon, 24 Oct 2011, Justin Ruggles wrote:

On 10/24/2011 07:30 AM, Justin Ruggles wrote:

On 10/24/2011 04:22 AM, Martin Storsjö wrote:

On Sun, 23 Oct 2011, Justin Ruggles wrote:

It is broken because an AVCodecContext can be opened/closed multiple
times, and sample_rate is getting divided by 2 each time that happens.

This removes the only use of lowres for audio.
---
avconv.c             |    5 +----
libavcodec/g722dec.c |   18 +++++-------------
2 files changed, 6 insertions(+), 17 deletions(-)

Hmm, I'm wondering, just out of curiosity, if this feature still could be
supported in some other way (e.g. enabled via a private avoption or so).

The sample rate can't be set explicitly in the decoder (according to the
spec, this is only used for 16 kHz audio, but there's of course nothing
limiting its use to that in practice) but gets set by the container. Would
it work better if the originally set sample_rate was restored by the close
function, or is that just piling more mess on all it for no good reason?
And would that work without avconv knowing anything about it beforehand,
just reading the sample_rate is set after avcodec_open() is called?
(Currently there's the sample_rate >>= lowres part in avconv.c that this
patch removes...) Then it should, more or less, work like any decoder that
sets the sample_rate during avcodec_open().

If this just makes things more complicated or is too messy, I'm ok with
the change in this patch - it's not a necessary feature for the decoder
anyway.


My original plan was to make it a private option, but it didn't work
properly. I didn't think of restoring the original sample_rate in
close() though. I'll try it out.


The only way I can get this to work is to leave it as lowres and change
the input sample rate in avconv instead of in open().

Private option doesn't work in avconv because the decoder is not opened
until after the encoder has been opened. Therefore, it resamples from
half-rate to full-rate.

Does anyone really want this? If so I can fix avconv and avplay instead.

Not at that cost with so much ugly messing around in avconv/avplay - I'm fine with skipping it instead then. Patch 1 ok then I guess.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to