From: ddennedy Date: Thu, 18 Mar 2004 14:29:36 +0000 (+0000) Subject: revert avformat pts offset change and note bug in docs X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4821d55880677f32957f25cdecca922469edaf7e;p=mlt revert avformat pts offset change and note bug in docs git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@220 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/docs/services.txt b/docs/services.txt index 74672b9f..e1470f52 100644 --- a/docs/services.txt +++ b/docs/services.txt @@ -16,9 +16,10 @@ Producers Constructor Argument 'file' - a filename specification or URL in the form: - [{protocol}|{format}]:{resource}[?{format-parameter}[&{format-parameter}]] - For example, video4linux:/dev/video1?width=320&height=240 - Note: on the bash command line, '&' must be escaped as '\&' + [{protocol}|{format}]:{resource}[?{format-parameter}[&{format-parameter}...]] + For example, video4linux:/dev/video1?width:320&height:240 + Note: on the bash command line, & must be escaped as '\&'. + Also, note the use of ':' instead of '=' for parameters. Use 'ffmpeg -formats' to see a list of supported protocols and formats. @@ -57,6 +58,8 @@ Producers MPEG seeking is inaccurate - doesn't seek to i-frames so you may get junk for a few frames. RAW DV seeking not supported. + Fails to play beyond first frame of video of sources with PTS not + starting at 0 (video4linux). fezzik diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 6ebd5683..742934f7 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -232,7 +232,7 @@ static int producer_open( mlt_producer this, char *file ) { mrl[0] = 0; char *name = strdup( ++mrl ); - char *value = strchr( name, '=' ); + char *value = strchr( name, ':' ); if ( value ) { value[0] = 0; @@ -379,7 +379,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form mlt_position expected = mlt_properties_get_position( properties, "video_expected" ); // Calculate the real time code - double real_timecode = producer_time_of_frame( this, position ) + mlt_properties_get_double( properties, "_v_pts_offset" ); + double real_timecode = producer_time_of_frame( this, position ); // Get the video stream AVStream *stream = context->streams[ index ]; @@ -493,11 +493,6 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form { if ( pkt.pts != AV_NOPTS_VALUE && pkt.pts != 0 ) { - if ( current_time == 0 ) - { - mlt_properties_set_double( properties, "_v_pts_offset", ( double )( pkt.pts / 1000000 ) ); - real_timecode += pkt.pts / 1000000; - } current_time = ( double )pkt.pts / 1000000.0; } else