Andreas Rheinhardt
1cf238d3bf
avcodec/cbs: Factor out common code for writing units
...
All cbs-functions to write units share a common pattern:
1. They check whether they have a write buffer (that is used to store
the unit's data until the needed size becomes known after writing the
unit when a dedicated buffer will be allocated).
2. They use this buffer for a PutBitContext.
3. The (codec-specific) writing takes place through the PutBitContext.
4. The return value is checked. AVERROR(ENOSPC) here always indicates
that the buffer was too small and leads to a reallocation of said
buffer.
5. The final buffer will be allocated and the data copied.
This commit factors this common code out in a single function in cbs.c.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
(cherry picked from commit 7c92eaace2 )
2019-12-31 16:57:37 -03:00
..
2019-07-19 01:23:23 +02:00
2019-07-07 13:29:50 +01:00
2019-12-31 19:51:55 +01:00
2019-06-20 14:47:46 -03:00
2019-06-04 13:06:41 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:55 +01:00
2019-06-25 13:30:09 +02:00
2019-06-20 14:47:46 -03:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:57 +01:00
2019-06-20 14:47:46 -03:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-06-12 20:06:20 +10:00
2019-12-31 19:51:56 +01:00
2019-11-19 19:48:33 -03:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:56 +01:00
2019-06-04 13:06:41 +02:00
2019-08-04 21:16:28 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-06-20 14:47:46 -03:00
2019-12-31 19:51:57 +01:00
2019-07-08 22:59:41 +01:00
2019-07-17 17:56:15 -03:00
2019-09-04 20:26:35 +02:00
2019-09-04 20:26:35 +02:00
2019-06-26 19:05:29 +02:00
2019-12-31 19:51:56 +01:00
2019-06-26 19:05:29 +02:00
2019-06-26 21:25:10 +02:00
2019-06-14 21:36:39 +02:00
2019-08-04 21:16:28 +02:00
2019-09-23 10:11:25 -03:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:57 +01:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-11-19 23:40:02 -03:00
2019-07-08 22:59:41 +01:00
2019-07-20 11:28:09 -03:00
2019-07-20 11:28:09 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-05-29 00:16:41 +01:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-06-20 14:47:46 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-06-28 20:10:43 +02:00
2019-08-04 21:16:28 +02:00
2019-12-31 19:51:56 +01:00
2019-06-12 20:06:20 +10:00
2019-12-31 19:51:57 +01:00
2019-09-04 20:26:35 +02:00
2019-08-05 19:34:33 +02:00
2019-09-04 20:26:35 +02:00
2019-07-17 23:18:50 +02:00
2019-12-31 19:51:57 +01:00
2019-07-14 22:17:43 +02:00
2019-07-13 19:34:15 +02:00
2019-07-20 19:05:02 +02:00
2019-12-31 19:51:56 +01:00
2019-08-04 21:16:28 +02:00
2019-08-04 21:16:28 +02:00
2019-07-07 22:34:05 +02:00
2019-12-31 19:51:56 +01:00
2019-12-06 21:33:54 -03:00
2019-05-27 19:01:38 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-07-07 22:17:07 +01:00
2019-12-31 19:51:57 +01:00
2019-07-19 21:42:38 +02:00
2019-09-04 20:26:35 +02:00
2019-06-21 18:28:00 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-07-08 09:56:29 +02:00
2019-08-04 16:19:25 +02:00
2019-07-19 21:42:38 +02:00
2019-07-08 22:59:41 +01:00
2019-06-12 12:01:26 +02:00
2019-07-08 22:59:41 +01:00
2019-07-19 21:42:38 +02:00
2019-07-14 13:04:46 -03:00
2019-07-07 22:34:05 +02:00
2019-07-07 22:59:22 +01:00
2019-07-07 13:29:51 +01:00
2019-07-07 13:29:50 +01:00
2019-08-27 20:10:35 -03:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-07-05 16:30:40 -03:00
2019-06-30 17:52:13 +02:00
2019-09-04 20:26:35 +02:00
2019-07-20 11:28:09 -03:00
2019-12-31 19:51:55 +01:00
2019-09-04 20:26:35 +02:00
2019-07-08 09:56:08 +02:00
2019-12-31 19:51:55 +01:00
2019-07-13 14:42:57 +02:00
2019-07-13 14:42:57 +02:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:57 +01:00
2019-07-08 10:00:41 +02:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:56 +01:00
2019-06-12 12:01:32 +02:00
2019-12-31 19:51:56 +01:00
2019-07-17 23:18:50 +02:00
2019-05-27 13:21:52 -03:00
2019-12-31 19:51:56 +01:00
2019-07-07 19:19:26 +01:00
2019-07-07 19:19:26 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:56 +01:00
2019-06-29 19:22:19 +02:00
2019-07-11 16:53:09 +02:00
2019-07-07 13:29:50 +01:00
2019-07-26 18:28:37 +02:00
2019-07-26 18:28:15 +02:00
2019-06-13 11:41:18 +02:00
2019-06-13 11:41:18 +02:00
2019-07-01 13:24:57 +08:00
2019-12-31 19:51:55 +01:00
2019-06-24 23:49:19 -03:00
2019-12-31 19:51:57 +01:00
2019-09-04 20:26:35 +02:00
2019-07-07 23:04:27 +01:00
2019-09-27 22:28:16 -03:00
2019-12-31 19:51:55 +01:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-06-05 13:19:59 +02:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-11-17 01:41:11 +01:00
2019-09-02 13:53:08 -07:00
2019-06-04 13:06:41 +02:00
2019-07-17 23:18:50 +02:00
2019-12-31 19:51:56 +01:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-07-01 13:24:01 +08:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-09-04 20:26:35 +02:00
2019-07-08 09:54:55 +02:00
2019-08-05 19:34:33 +02:00
2019-12-31 19:51:56 +01:00
2019-09-04 20:26:35 +02:00
2019-07-08 09:38:05 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:56 +01:00
2019-07-08 09:38:03 +02:00
2019-06-24 00:19:03 +02:00
2019-07-20 13:43:06 -03:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-09-04 20:26:35 +02:00
2019-05-30 19:27:05 +02:00
2019-07-09 13:23:47 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:56 +01:00
2019-06-12 12:01:32 +02:00
2019-06-03 21:16:22 +01:00
2019-06-12 22:27:13 +01:00
2019-06-03 21:16:22 +01:00
2019-06-03 21:16:22 +01:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:57 +01:00
2019-06-26 21:26:41 +02:00
2019-07-21 18:36:18 +02:00
2019-06-26 21:40:19 +02:00
2019-07-11 09:34:34 +08:00
2019-12-31 19:51:56 +01:00
2019-06-04 13:06:41 +02:00
2019-09-06 23:00:46 +02:00
2019-09-04 20:26:35 +02:00
2019-06-08 09:37:26 +10:00
2019-06-12 20:06:20 +10:00
2019-12-31 19:51:56 +01:00
2019-09-04 20:26:35 +02:00
2019-09-04 20:26:35 +02:00
2019-07-07 23:04:33 +01:00
2019-06-20 14:47:46 -03:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:55 +01:00
2019-08-05 19:34:33 +02:00
2019-06-21 18:28:00 +02:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:57 +01:00
2019-06-25 13:30:09 +02:00
2019-12-31 19:51:56 +01:00