comparison utils.c @ 5418:58fb1f12d94f libavformat

Calls to url_fseek should have their return value checked in av_seek_frame_binary, just as they do in av_seek_frame_generic. Otherwise, function may return success even though url_fseek reported failure. Patch by Sean Soria, first.last at gmail
author daniel
date Sun, 06 Dec 2009 00:03:53 +0000
parents e1a281c9d852
children 3e568c0b36d3
comparison
equal deleted inserted replaced
5417:9d7de5529047 5418:58fb1f12d94f
1309 int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){ 1309 int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){
1310 AVInputFormat *avif= s->iformat; 1310 AVInputFormat *avif= s->iformat;
1311 int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; 1311 int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
1312 int64_t ts_min, ts_max, ts; 1312 int64_t ts_min, ts_max, ts;
1313 int index; 1313 int index;
1314 int64_t ret;
1314 AVStream *st; 1315 AVStream *st;
1315 1316
1316 if (stream_index < 0) 1317 if (stream_index < 0)
1317 return -1; 1318 return -1;
1318 1319
1361 pos= av_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ts_min, ts_max, flags, &ts, avif->read_timestamp); 1362 pos= av_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ts_min, ts_max, flags, &ts, avif->read_timestamp);
1362 if(pos<0) 1363 if(pos<0)
1363 return -1; 1364 return -1;
1364 1365
1365 /* do the seek */ 1366 /* do the seek */
1366 url_fseek(s->pb, pos, SEEK_SET); 1367 if ((ret = url_fseek(s->pb, pos, SEEK_SET)) < 0)
1368 return ret;
1367 1369
1368 av_update_cur_dts(s, st, ts); 1370 av_update_cur_dts(s, st, ts);
1369 1371
1370 return 0; 1372 return 0;
1371 } 1373 }