On 06/14/2011 02:19 PM, Anton Khirnov wrote:

> 
> On Tue, 14 Jun 2011 09:24:48 -0400, Justin Ruggles <[email protected]> 
> wrote:
>> On 06/14/2011 06:58 AM, Anton Khirnov wrote:
>>
>>> -    memset(ap, 0, sizeof(*ap));
>>> -    ap->prealloced_context = 1;
>>> -    ap->sample_rate = audio_sample_rate;
>>> -    ap->channels = audio_channels;
>>> -    ap->time_base.den = frame_rate.num;
>>> -    ap->time_base.num = frame_rate.den;
>>> -    ap->width = frame_width;
>>> -    ap->height = frame_height;
>>> -    ap->pix_fmt = frame_pix_fmt;
>>> -   // ap->sample_fmt = audio_sample_fmt; //FIXME:not implemented in 
>>> libavformat
>>> -    ap->channel = video_channel;
>>> -    ap->standard = video_standard;
>>> -
>>> -    set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL);
>>
>>
>> Can these at least be emulated temporarily using the associated demuxer
>> private options?  I fear there could be some weird side effects and
>> confusion for users by changing the commandline behavior for demuxers only.
>>
> 
> I'd like them to be emulated permanently, but it's not as easy as it looks.
> 
> For example, take -ar. It sets an audio_sample_rate global, which is 
> initialized
> to a default value of 44100, so i can't easily check if the user set it
> or not.
> Further, it gets set in opt_input_file() from the audio stream value,
> for some nefarious future use. I can only guess how it's really supposed
> to work and most probably it only does what it's meant to in case of one
> input and one output file.
> In any case, touching it is likely to break something else.


I'm pretty certain it would still work the same as it does now if the
global audio_sample_rate is left as-is and we also add the demuxer
private option in opt_audio_rate().  If opt_audio_rate() is called, that
means the user set it.  If not, then the demuxer private default value
will be used to set the decoder value, which then gets put in the global
audio_sample_rate.  And so the cryptic behavior is maintained except for
the default value, which will now be determined by the demuxer instead
of by ffmpeg.

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

Reply via email to