[MPlayer-dev-eng] [PATCH] Audio support for AVISynth
Alexander 'Lazy Ranma' Ponyatikh
ranma at 274.ru
Tue Jul 25 18:01:23 CEST 2006
>> + sh_video_t *sh_video = ((demux_stream_t *) ds)->sh;
>> + if (AVS->video_info->num_frames < AVS->frameno) return 0; // EOF
>> +
>> + curr_frame = AVS->avs_get_frame(AVS->clip, AVS->frameno);
>> + if (!curr_frame)
>> + {
>> + mp_msg(MSGT_DEMUX, MSGL_V, "AVS: error getting frame -- EOF ??\n");
>> + return 0;
>> + }
> You only added a few spaces here, please, if you move it to a seperate
> patch everyone will have a much easier time to understand what this
> patch actually does, what it changes and why it didn't work before (or
> in other words, learn from it).
No, this block of code has been moved into new if statement.
>> + AVS->frameno++;
>> + AVS->avs_release_video_frame(curr_frame);
> Why were these two lines moved up? Is this necessary for the audio
> support to work or is this a seperate issue or just "cosmetic"?
It is necessary. They have been moved inside "if
(avs_has_video(AVS->video_info) && (ds == demuxer->video))" statement.
>> + AVS->sampleno = (int) floor((float) AVS->frameno / sh_video->fps * (float) sh_audio->wf->nSamplesPerSec);
> Any reason not to use AVS->fps here? esp. since I'm not sure if
sh_video->>fps doesn't get changed when you use -speed or -fps command
> line options, that might have weird effects on that code then.
That's right, it should be AVS->fps.
More information about the MPlayer-dev-eng
mailing list