[Ffmpeg-devel] [PATCH] ffmpeg.c: raw subtitles stream support; vhook crashed if -vcodec copy
Michael Niedermayer
michaelni
Wed Oct 25 12:21:27 CEST 2006
Hi
On Wed, Oct 25, 2006 at 06:04:12PM +0900, Alexey Sidelnikov wrote:
> sorry for raising the same issue again, but last time i failed to attach
> a patch file: http://article.gmane.org/gmane.comp.video.ffmpeg.devel/38695
>
> I will duplicate my old message here if you don't mind.
> -----------------------------------------------------------
>
> I'm sorry, there are two non-related patches in one diff, but both are
> very simple, and both are for ffmpeg.c, so I hope that is okay.
>
> 1. First patch is to allow raw subtitle stream copying. It was proposed
> originally here:
>
> http://article.gmane.org/gmane.comp.video.ffmpeg.devel/38587
>
> but the author missed that if there is no subtitles at all in the input
> file, then ffmpeg will crash. So I just added one more check to
> av_encode() function.
>
> 2. Following this topic:
>
> http://article.gmane.org/gmane.comp.video.ffmpeg.devel/38483
>
> if pre_process_video_frame() is called when video stream is copied, then
> AVPicture is not valid in it, and ffmpeg will crash. I added 2 checks -
> one in av_encode() during streams sanity check - that will notify a user
> right now, and the other one just before pre_process_video_frame() call
> - to make sure ffmpeg won't crash somewhere in the future, when a new
> pre_process command will be added.
[...]
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c (revision 6731)
> +++ ffmpeg.c (working copy)
> @@ -1150,8 +1150,12 @@
>
> buffer_to_free = NULL;
> if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO) {
> - pre_process_video_frame(ist, (AVPicture *)&picture,
> - &buffer_to_free);
> + if (ist->decoding_needed) {
> + pre_process_video_frame(ist, (AVPicture *)&picture,
> &buffer_to_free);
> + }
> + else {
> + fprintf(stderr, "video frame can not be
> preprocessed if video stream is copied\n");
> + }
this patch looks malformed due to linebreaks
also this looks like ffmpeg would constantly print this error message instead
of aborting which it should
also iam not sure if this wouldnt also output this error message if streamcopy
without any filtering is done (did you test that?)
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list