Unified · Split
| @@ -605,20 +605,26 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize, · 604 unmodified lines | ||
| 605 | 605 | } else { |
| 606 | 606 | os->pflags = 0; |
| 607 | 607 | os->pduration = 0; |
| 608 | + | |
| 609 | + ret = 0; | |
| 608 | 610 | if (os->codec && os->codec->packet) { |
| 609 | 611 | if ((ret = os->codec->packet(s, idx)) < 0) { |
| 610 | 612 | av_log(s, AV_LOG_ERROR, "Packet processing failed: %s\n", av_err2str(ret)); |
| 611 | 613 | return ret; |
| 612 | 614 | } |
| 613 | 615 | } |
| 614 | − if (sid) | |
| 615 | − *sid = idx; | |
| 616 | − if (dstart) | |
| 617 | − *dstart = os->pstart; | |
| 618 | − if (dsize) | |
| 619 | − *dsize = os->psize; | |
| 620 | − if (fpos) | |
| 621 | − *fpos = os->sync_pos; | |
| 616 | + | |
| 617 | + if (!ret) { | |
| 618 | + if (sid) | |
| 619 | + *sid = idx; | |
| 620 | + if (dstart) | |
| 621 | + *dstart = os->pstart; | |
| 622 | + if (dsize) | |
| 623 | + *dsize = os->psize; | |
| 624 | + if (fpos) | |
| 625 | + *fpos = os->sync_pos; | |
| 626 | + } | |
| 627 | + | |
| 622 | 628 | os->pstart += os->psize; |
| 623 | 629 | os->psize = 0; |
| 624 | 630 | if(os->pstart == os->bufpos) |
| @@ -43,6 +43,7 @@ struct ogg_codec { · 42 unmodified lines | ||
| 43 | 43 | * @return < 0 (AVERROR) code or -1 on error |
| 44 | 44 | * == 0 if the packet was a regular data packet. |
| 45 | 45 | * == 0 or 1 if the packet was a header from a chained bitstream. |
| 46 | + * (1 will cause the packet to be skiped in calling code (ogg_packet()) | |
| 46 | 47 | */ |
| 47 | 48 | int (*packet)(AVFormatContext *, int); |
| 48 | 49 | /** |