changeset 1658:a7251d9e82e9

parse_es init fixed
author arpi
date Thu, 23 Aug 2001 13:19:30 +0000
parents f6d3c1287748
children 6b71bbf515e4
files dec_video.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dec_video.c	Thu Aug 23 12:47:23 2001 +0000
+++ b/dec_video.c	Thu Aug 23 13:19:30 2001 +0000
@@ -591,6 +591,7 @@
  case DEMUXER_TYPE_MPEG_ES:
  case DEMUXER_TYPE_MPEG_PS: {
    // Find sequence_header first:
+   videobuf_len=0; videobuf_code_len=0;
    mp_msg(MSGT_DECVIDEO,MSGL_V,"Searching for sequence header... ");fflush(stdout);
    while(1){
       int i=sync_video_packet(d_video);
@@ -606,13 +607,13 @@
 //   sh_video=d_video->sh;sh_video->ds=d_video;
    mpeg2_init();
    // ========= Read & process sequence header & extension ============
-   videobuffer=memalign(8,VIDEOBUFFER_SIZE);
+   if(!videobuffer) videobuffer=memalign(8,VIDEOBUFFER_SIZE);
    if(!videobuffer){ 
      mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory\n");
      return 0;
 //     GUI_MSG( mplErrorShMemAlloc )
    }
-   videobuf_len=0;
+   
    if(!read_video_packet(d_video)){ 
      mp_msg(MSGT_DECVIDEO,MSGL_ERR,"FATAL: Cannot read sequence header!\n");
      return 0;