[MPlayer-dev-eng] vd_libmpeg2: change in video parameters causes mencoder to core-dump

Peter Niemayer niemayer at isg.de
Mon Sep 15 16:42:59 CEST 2003


Hi,

I just noticed that unlike mencoder 0.9, which silently ignored
changes of video parameters in mpeg-2 streams, mencoder 1.00pre1
will core dump.

In libmpcodecs/vd_libmpeg2.c there is a piece of code like this...

         case STATE_SEQUENCE:
            // video parameters inited/changed, (re)init libvo:
            if(!mpcodecs_config_vo(sh,
                info->sequence->width,
                info->sequence->height, IMGFMT_YV12)) return 0;
            break;

... that might be helpful to change aspect-ratios and alike during
replays with mplayer, but which causes mencoder to dump core if
it encounters such an event (at least when -ovc lavc is chosen).

It would be nice if either the encoder would be able to handle the
reconfig request or - much simpler - if a re-init would just be
avoided when the code is for mencoder, not mplayer.

A very crude workaround is the following patch - not proposed
as a permanent solution :-)

--- libmpcodecs.orig/vd_libmpeg2.c     Sun Sep 14 15:46:41 2003
+++ libmpcodecs/vd_libmpeg2.c   Sun Sep 14 15:44:24 2003
@@ -114,11 +114,17 @@
  //         if(!mpi) printf("\nNO PICTURE!\n");
             return mpi;
         case STATE_SEQUENCE:
-           // video parameters inited/changed, (re)init libvo:
-           if(!mpcodecs_config_vo(sh,
-               info->sequence->width,
-               info->sequence->height, IMGFMT_YV12)) return 0;
-           break;
+           {
+                // video parameters inited/changed, (re)init libvo:
+           static int conf_done = 0;
+                if (!conf_done) {
+                       conf_done = -1;
+                       if(!mpcodecs_config_vo(sh,
+                       info->sequence->width,
+                       info->sequence->height, IMGFMT_YV12)) return 0;
+                       }
+               break;
+               }
         case STATE_PICTURE: {
             int type=info->current_picture->flags&PIC_MASK_CODING_TYPE;
             mp_image_t* mpi;




cheers,

Peter Niemayer




More information about the MPlayer-dev-eng mailing list