Ticket #1727: mkv_demuxer_header_compression+ass_fix_pts_out_of_order.diff
| File mkv_demuxer_header_compression+ass_fix_pts_out_of_order.diff, 5.5 KB (added by , 16 years ago) |
|---|
-
libmpcodecs/vf_ass.c
329 329 330 330 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) 331 331 { 332 static short int zerar; 333 334 // ARZ 335 zerar = 0; 336 if(pts == MP_NOPTS_VALUE) 337 { 338 zerar = 1; 339 pts = vf_pts; 340 // if(!vf_quiet) mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"NOPTS vf_pts: %6.3fs Pts: %6.3fs\n", vf_pts, pts); 341 if(!vf_quiet) mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"NOPTS "); 342 } 343 if(!vf_quiet) mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"Pts:%6.1fs ", pts); 344 332 345 ASS_Image* images = eosd_render_frame(pts, NULL); 333 346 prepare_image(vf, mpi); 334 347 if (images) render_frame(vf, mpi, images); 348 349 // ARZ 350 if (zerar) pts = MP_NOPTS_VALUE; 335 351 336 352 return vf_next_put_image(vf, vf->dmpi, pts); 337 353 } -
libmpcodecs/vf.c
213 213 NULL 214 214 }; 215 215 216 // ARZ 217 double vf_pts; 218 int vf_quiet; 219 216 220 // For the vf option 217 221 m_obj_settings_t* vf_settings = NULL; 218 222 const m_obj_list_t vf_obj_list = { -
libmpcodecs/vf.h
22 22 #include "m_option.h" 23 23 #include "mp_image.h" 24 24 25 // ARZ 26 extern double vf_pts; 27 extern int vf_quiet; 28 25 29 extern m_obj_settings_t* vf_settings; 26 30 extern const m_obj_list_t vf_obj_list; 27 31 -
mplayer.c
287 287 char** video_driver_list=NULL; 288 288 char** audio_driver_list=NULL; 289 289 290 // ARZ 291 static short int initial_sync = 0; 292 290 293 // sub: 291 294 char *font_name=NULL; 292 295 char *sub_font_name=NULL; … … 3597 3600 mpctx->sh_audio=mpctx->d_audio->sh; 3598 3601 mpctx->sh_video=mpctx->d_video->sh; 3599 3602 3603 vf_quiet = quiet; 3604 3600 3605 if(mpctx->sh_video){ 3601 3606 3602 3607 current_module="video_read_properties"; … … 3889 3894 /*========================== PLAY VIDEO ============================*/ 3890 3895 3891 3896 vo_pts=mpctx->sh_video->timer*90000.0; 3897 3898 // ARZ 3899 if ( ! initial_sync ) 3900 { 3901 seek_to_sec = mpctx->sh_video->pts; 3902 initial_sync = 1; 3903 } 3904 vf_pts = ( mpctx->sh_video->timer + seek_to_sec); 3905 3892 3906 vo_fps=mpctx->sh_video->fps; 3893 3907 3894 3908 if (!mpctx->num_buffered_frames) { -
libmpdemux/demux_mkv.c
366 366 } 367 367 *size = dstlen; 368 368 } 369 370 // ARZ 371 if (track->encodings[i].comp_algo == 3) 372 { 373 if (*size >= SIZE_MAX - track->encodings[i].comp_settings_len) 374 { 375 mp_msg(MSGT_DEMUX, MSGL_ERR, "[mkv] integer overflow in demux_mkv_decode!\n"); 376 break; 377 } 378 379 modified = 1; 380 *dest = malloc(*size + track->encodings[i].comp_settings_len); 381 memcpy(*dest, track->encodings[i].comp_settings, track->encodings[i].comp_settings_len); 382 memcpy(*dest + track->encodings[i].comp_settings_len, src, *size); 383 *size += track->encodings[i].comp_settings_len; 384 } 369 385 } 370 386 371 387 return modified; … … 526 542 track->tnum); 527 543 } 528 544 529 if (e.comp_algo != 0 && e.comp_algo != 2) { 545 // ARZ 546 if (e.comp_algo != 0 && e.comp_algo != 2 && e.comp_algo != 3 ) { 530 547 mp_msg(MSGT_DEMUX, MSGL_WARN, 531 548 MSGTR_MPDEMUX_MKV_UnknownCompression, 532 549 track->tnum, e.comp_algo); -
mencoder.c
175 175 static int play_n_frames=-1; 176 176 static int play_n_frames_mf=-1; 177 177 178 // ARZ 179 static short int initial_sync = 0; 180 178 181 // sub: 179 182 char *font_name=NULL; 180 183 char *sub_font_name=NULL; … … 455 458 } 456 459 } 457 460 if (sh_video->pts >= end_pts) done = 1; 461 462 // ARZ 463 if ( ! initial_sync ) 464 { 465 seek_to_sec = sh_video->pts; 466 initial_sync = 1; 467 } 468 vf_pts = ( sh_video->timer + seek_to_sec); 458 469 459 470 if (vfilter) { 460 471 int softskip = (vfilter->control(vfilter, VFCTRL_SKIP_NEXT_FRAME, 0) == CONTROL_TRUE); … … 815 826 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); 816 827 } 817 828 829 // ARZ 830 vf_quiet = quiet; 831 818 832 if (sh_audio) { 819 833 new_srate = sh_audio->samplerate; 820 834 if (playback_speed != 1.0) { … … 1523 1537 if(skip_flag<=0) muxer_write_chunk(mux_v,sizeof(int),AVIIF_KEYFRAME, MP_NOPTS_VALUE, MP_NOPTS_VALUE); 1524 1538 break; 1525 1539 default: 1540 1541 // ARZ 1542 if ( ! initial_sync ) 1543 { 1544 seek_to_sec = sh_video->pts; 1545 initial_sync = 1; 1546 } 1547 vf_pts = ( sh_video->timer + seek_to_sec); 1548 // fprintf( stderr, "seek_to_sec: %6.3f sh_video->timer: %6.10fs sh_video->pts: %6.3fs vf_pts: %6.10fs ", 1549 // seek_to_sec, sh_video->timer, sh_video->pts, ( sh_video->timer + seek_to_sec) ); 1550 1526 1551 // decode_video will callback down to ve_*.c encoders, through the video filters 1527 1552 { 1528 1553 int drop_frame = skip_flag > 0 &&
