EncoderPlugin: pass Tag reference to method tag()
This commit is contained in:
		| @@ -65,7 +65,7 @@ struct EncoderPlugin { | |||||||
|  |  | ||||||
| 	bool (*pre_tag)(Encoder *encoder, Error &error); | 	bool (*pre_tag)(Encoder *encoder, Error &error); | ||||||
|  |  | ||||||
| 	bool (*tag)(Encoder *encoder, const Tag *tag, | 	bool (*tag)(Encoder *encoder, const Tag &tag, | ||||||
| 		    Error &error); | 		    Error &error); | ||||||
|  |  | ||||||
| 	bool (*write)(Encoder *encoder, | 	bool (*write)(Encoder *encoder, | ||||||
| @@ -240,7 +240,7 @@ encoder_pre_tag(Encoder *encoder, Error &error) | |||||||
|  * @return true on success |  * @return true on success | ||||||
|  */ |  */ | ||||||
| static inline bool | static inline bool | ||||||
| encoder_tag(Encoder *encoder, const Tag *tag, Error &error) | encoder_tag(Encoder *encoder, const Tag &tag, Error &error) | ||||||
| { | { | ||||||
| 	assert(encoder->open); | 	assert(encoder->open); | ||||||
| 	assert(!encoder->pre_tag); | 	assert(!encoder->pre_tag); | ||||||
|   | |||||||
| @@ -279,7 +279,7 @@ copy_tag_to_vorbis_comment(vorbis_comment *vc, const Tag &tag) | |||||||
| } | } | ||||||
|  |  | ||||||
| static bool | static bool | ||||||
| vorbis_encoder_tag(Encoder *_encoder, const Tag *tag, | vorbis_encoder_tag(Encoder *_encoder, const Tag &tag, | ||||||
| 		   gcc_unused Error &error) | 		   gcc_unused Error &error) | ||||||
| { | { | ||||||
| 	struct vorbis_encoder &encoder = *(struct vorbis_encoder *)_encoder; | 	struct vorbis_encoder &encoder = *(struct vorbis_encoder *)_encoder; | ||||||
| @@ -288,7 +288,7 @@ vorbis_encoder_tag(Encoder *_encoder, const Tag *tag, | |||||||
| 	/* write the vorbis_comment object */ | 	/* write the vorbis_comment object */ | ||||||
|  |  | ||||||
| 	vorbis_comment_init(&comment); | 	vorbis_comment_init(&comment); | ||||||
| 	copy_tag_to_vorbis_comment(&comment, *tag); | 	copy_tag_to_vorbis_comment(&comment, tag); | ||||||
|  |  | ||||||
| 	/* reset ogg_stream_state and begin a new stream */ | 	/* reset ogg_stream_state and begin a new stream */ | ||||||
|  |  | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ RecorderOutput::SendTag(const Tag &tag) | |||||||
| 	Error error; | 	Error error; | ||||||
| 	if (!encoder_pre_tag(encoder, error) || | 	if (!encoder_pre_tag(encoder, error) || | ||||||
| 	    !EncoderToFile(error) || | 	    !EncoderToFile(error) || | ||||||
| 	    !encoder_tag(encoder, &tag, error)) | 	    !encoder_tag(encoder, tag, error)) | ||||||
| 		LogError(error); | 		LogError(error); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -498,7 +498,7 @@ static void my_shout_set_tag(AudioOutput *ao, | |||||||
| 		Error error; | 		Error error; | ||||||
| 		if (!encoder_pre_tag(sd->encoder, error) || | 		if (!encoder_pre_tag(sd->encoder, error) || | ||||||
| 		    !write_page(sd, error) || | 		    !write_page(sd, error) || | ||||||
| 		    !encoder_tag(sd->encoder, &tag, error)) { | 		    !encoder_tag(sd->encoder, tag, error)) { | ||||||
| 			LogError(error); | 			LogError(error); | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -512,7 +512,7 @@ HttpdOutput::SendTag(const Tag &tag) | |||||||
| 		/* send the tag to the encoder - which starts a new | 		/* send the tag to the encoder - which starts a new | ||||||
| 		   stream now */ | 		   stream now */ | ||||||
|  |  | ||||||
| 		encoder_tag(encoder, &tag, IgnoreError()); | 		encoder_tag(encoder, tag, IgnoreError()); | ||||||
|  |  | ||||||
| 		/* the first page generated by the encoder will now be | 		/* the first page generated by the encoder will now be | ||||||
| 		   used as the new "header" page, which is sent to all | 		   used as the new "header" page, which is sent to all | ||||||
|   | |||||||
| @@ -90,7 +90,7 @@ main(gcc_unused int argc, gcc_unused char **argv) | |||||||
| 		tag_builder.Commit(tag); | 		tag_builder.Commit(tag); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	success = encoder_tag(encoder, &tag, IgnoreError()); | 	success = encoder_tag(encoder, tag, IgnoreError()); | ||||||
| 	assert(success); | 	assert(success); | ||||||
|  |  | ||||||
| 	encoder_to_stdout(*encoder); | 	encoder_to_stdout(*encoder); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann