ffmpeg: fixed AVSEEK_SIZE
With whence==AVSEEK_SIZE, the seek function should return the file size, not the current offset. Check the return value of input_stream_seek().
This commit is contained in:
		| @@ -89,9 +89,15 @@ static int mpd_ffmpeg_read(URLContext *h, unsigned char *buf, int size) | |||||||
| static int64_t mpd_ffmpeg_seek(URLContext *h, int64_t pos, int whence) | static int64_t mpd_ffmpeg_seek(URLContext *h, int64_t pos, int whence) | ||||||
| { | { | ||||||
| 	struct ffmpeg_stream *stream = (struct ffmpeg_stream *) h->priv_data; | 	struct ffmpeg_stream *stream = (struct ffmpeg_stream *) h->priv_data; | ||||||
| 	if (whence != AVSEEK_SIZE) { //only ftell | 	bool ret; | ||||||
| 		(void) input_stream_seek(stream->input, pos, whence); |  | ||||||
| 	} | 	if (whence == AVSEEK_SIZE) | ||||||
|  | 		return stream->input->size; | ||||||
|  |  | ||||||
|  | 	ret = input_stream_seek(stream->input, pos, whence); | ||||||
|  | 	if (!ret) | ||||||
|  | 		return -1; | ||||||
|  |  | ||||||
| 	return stream->input->offset; | 	return stream->input->offset; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann