[Ffmpeg-devel] [FWD] [PATCH] immediate decoding of dvd stills
Michael Niedermayer
michaelni
Wed Nov 29 02:19:11 CET 2006
Hi
On Wed, Nov 29, 2006 at 01:01:58AM +0100, Nico Sabbi wrote:
> Michael Niedermayer wrote:
>
> >is there a problem with return buf_size; ?
>
> no, but why returning ret < bytes actually consumed? I find
> it misleadig
hmm, i didnt suggest return 0, but i see the problem now, i assumed that
there would always be 1 frame per packet and the end code also alone in one
that of course isnt guranteed even though it should always be the case with
an AVParser
[...]
> Index: libavcodec/mpeg12.c
> ===================================================================
> --- libavcodec/mpeg12.c (revisione 7167)
> +++ libavcodec/mpeg12.c (copia locale)
> @@ -3037,6 +3037,12 @@
> }
> }
> }
> + }else{
> + /* look for SEQ_END_CODE at the last data in this buffer*/
> + /* dvd's won't send the next frame start on still images*/
> + /* SEQ_END_CODE will have to stay at the beginning of a frame*/
> + if(state == SEQ_END_CODE)
> + return i-3;
> }
> pc->state= state;
> return END_NOT_FOUND;
> @@ -3054,11 +3060,12 @@
> int ret, input_size;
> AVFrame *picture = data;
> MpegEncContext *s2 = &s->mpeg_enc_ctx;
> + int endsequence = !memcmp(buf, (char[]){0,0,1,0xB7}, 4);
> dprintf("fill_buffer\n");
buf can be NULL if buf_size==0
>
> - if (buf_size == 0) {
> + if (buf_size == 0 || endsequence) {
> /* special case for last picture */
> - if (s2->low_delay==0 && s2->next_picture_ptr) {
> + if (s2->low_delay==0 && !endsequence && s2->next_picture_ptr) {
> *picture= *(AVFrame*)s2->next_picture_ptr;
> s2->next_picture_ptr= NULL;
this is wrong, if you output a picture, then it must be removed otherwise
it would be output again with the next I frame
and no iam not saying s2->next_picture_ptr= NULL is enough for this, just
that doing nothing is definitly not correct
[...]
--
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