summaryrefslogtreecommitdiff
path: root/libavformat/segafilmenc.c
Commit message (Collapse)AuthorAge
* avformat/segafilmenc: Add deinit functionAndreas Rheinhardt2020-02-25
| | | | | | | | Prevents memleaks when the trailer is never written or when shifting the data fails when writing the trailer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilmenc: Combine several checksAndreas Rheinhardt2020-02-25
| | | | | | | by moving them around. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilmenc: Remove redundant checksAndreas Rheinhardt2020-02-22
| | | | | | | | | | | | | | | | | | If an audio stream is present, the Sega FILM muxer checks for its compability with the container during init, so that the very same check needn't be repeated during writing the trailer. Essentially the same is true for the presence of a video stream: It has already been checked during init. Furthermore, after the check for the presence of a video stream succeeded, a pointer is set to point to the video stream. Yet said pointer (which was NULL before) will be derefenced anyway regardless of the result of the check. Coverity thus complained about this in CID 1434155 and removing this pointless check will also fix this issue. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilmenc: Remove AVClassAndreas Rheinhardt2020-02-15
| | | | | | | | | This muxer does not have any private options and so does not need a private class. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc, segafilmenc: Remove unnecessary avio_tell()Andreas Rheinhardt2020-01-17
| | | | | | | | | | | | | | When the faststart option for the mov/mp4 muxer is used, the current position (i.e. the size of the already written data pre-shifting) was evaluated twice: First in an initialization and then again later, overwriting the first value without having ever touched it. So remove the initialization. Also, the clone of this code in the Sega FILM muxer behaves the same and has been treated the same. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilmenc: Check early whether video is allowedAndreas Rheinhardt2020-01-14
| | | | | | | | | | The current code only checks when writing the trailer whether the video format and Codec ID are actually compatible with the container. At this point, a lot of data will already have been written (in vain, of course), so check during the init function instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilmenc: Postpone check for existence of video streamAndreas Rheinhardt2020-01-14
| | | | | | | | | Up until now, the Sega FILM muxer complained if the first stream wasn't a video stream that there is no video stream at all which is of course nonsense. So postpone this check. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilmenc: Fix undefined left shift of 1 by 31 placesAndreas Rheinhardt2020-01-14
| | | | | | | by changing the type to unsigned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: remove more unneeded avio_flush() callsMarton Balint2020-01-07
| | | | | | | | | | | | These instances are simply redundant or present because avio_flush() used to be required before doing a seekback. That is no longer the case, aviobuf code does the flush automatically on seek. This only affects code which is either disabled for streaming IO contexts or does no seekbacks after the flush, so this change should have no adverse effect on streaming. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/segafilmenc: remove unneeded codeSteven Liu2019-10-22
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/segafilmenc - set keyframe bit correctlyGyan Doshi2018-05-08
| | | | | | | | As per https://web.archive.org/web/20020803104640/http://www.pcisys.net:80/~melanson/codecs/film-format.txt, the top bit of the info1 chunk is set as 1 for inter-coded frames and 0 otherwise.
* lavf/segafilmenc: Do not mix variable declaration and code.Carl Eugen Hoyos2018-04-10
| | | | Fixes two warnings: ISO C90 forbids mixed declarations and code
* Add Sega FILM muxerMisty De Meo2018-04-05
Signed-off-by: Josh de Kock <josh@itanimul.li>